Skip to content

Commit

Permalink
Completion of module macro (#1508)
Browse files Browse the repository at this point in the history
Add completion for ?MODULE:
  • Loading branch information
plux committed Apr 30, 2024
1 parent 8e7e27a commit eceb806
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apps/els_lsp/src/els_completion_provider.erl
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ find_completions(
{ItemFormat, TypeOrFun} =
completion_context(Document, Line, Column, Tokens),
exported_definitions(Module, TypeOrFun, ItemFormat);
[{var, _, 'MODULE'}, {'?', _}, {'fun', _} | _] ->
Module = els_uri:module(els_dt_document:uri(Document)),
exported_definitions(Module, 'function', arity_only);
[{var, _, 'MODULE'}, {'?', _} | _] = Tokens ->
Module = els_uri:module(els_dt_document:uri(Document)),
{ItemFormat, TypeOrFun} =
completion_context(Document, Line, Column, Tokens),
exported_definitions(Module, TypeOrFun, ItemFormat);
_ ->
[]
end;
Expand Down

0 comments on commit eceb806

Please sign in to comment.