Skip to content

Commit

Permalink
Fix invalid crossref warning for Mod:module_info() (#1471)
Browse files Browse the repository at this point in the history
  • Loading branch information
plux committed Jan 8, 2024
1 parent 3e54aae commit d351643
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
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

0 comments on commit d351643

Please sign in to comment.