Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid crossref warning for Mod:module_info() #1474

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ main() ->

% At lease one failure so we know the diagnostic is running
unknown_module:nonexistent(),
Mod:module_info(),
Mod:module_info(module),
ok.
16 changes: 8 additions & 8 deletions apps/els_lsp/src/els_crossref_diagnostics.erl
Original file line number Diff line number Diff line change
Expand Up @@ -95,31 +95,31 @@ has_definition(
has_definition(
#{
kind := application,
id := {Module, module_info, Arity}
data := #{mod_is_variable := true}
},
_
) when Arity =:= 0; Arity =:= 1 ->
{ok, []} =/= els_dt_document_index:lookup(Module);
) ->
true;
has_definition(
#{
kind := application,
id := {record_info, 2}
id := {Module, module_info, Arity}
},
_
) ->
true;
) when Arity =:= 0; Arity =:= 1 ->
{ok, []} =/= els_dt_document_index:lookup(Module);
has_definition(
#{
kind := application,
id := {behaviour_info, 1}
id := {record_info, 2}
},
_
) ->
true;
has_definition(
#{
kind := application,
data := #{mod_is_variable := true}
id := {behaviour_info, 1}
},
_
) ->
Expand Down
Loading