Skip to content

Commit

Permalink
fix: filter out hidden functions from workspace symbols
Browse files Browse the repository at this point in the history
Closes #39
  • Loading branch information
mhanberg committed Jun 27, 2023
1 parent 96985c2 commit ea442a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/next_ls/symbol_table.ex
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ defmodule NextLS.SymbolTable do
)
end

for {name, {:v1, type, _meta, clauses}} <- defs, name != :__struct__, {meta, _, _, _} <- clauses do
for {name, {:v1, type, _meta, clauses}} <- defs,
not String.match?(to_string(name), ~r/__.*__/),
{meta, _, _, _} <- clauses do
:dets.insert(
state.table,
{mod,
Expand Down
1 change: 1 addition & 0 deletions test/next_ls/symbol_table_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ defmodule NextLS.SymbolTableTest do
module_line: 1,
struct: nil,
defs: [
__foo__: {:v1, :def, [line: 900], [{[line: 900], [], [], nil}]},
start_link:
{:v1, :def, [line: 44],
[
Expand Down

0 comments on commit ea442a2

Please sign in to comment.