Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.
Open
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
24 changes: 23 additions & 1 deletion apps/els_lsp/src/els_compiler_diagnostics.erl
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ diagnostics(Path, List, Severity) ->
diagnostic(
Path,
MessagePath,
range(Document, Anno),
exact_range(Desc, Document, Anno),
Document,
Module,
Desc,
Expand All @@ -204,6 +204,28 @@ diagnostics(Path, List, Severity) ->
[]
end.

-spec exact_range(
tuple(),
els_dt_document:item() | undefined,
erl_anno:anno() | none
) -> els_poi:poi_range().
exact_range({Flag, Fid}, #{pois := POIs} = Document, Anno) when
Flag == undefined_function;
Flag == duplicated_export
->
case lists:search(
fun(#{id := Id, kind := Kind}) ->
Id == Fid andalso Kind == export_entry
end, POIs)
of
{value, #{range := Range}} ->
Range;
false ->
range(Document, Anno)
end;
exact_range(_Desc, Document, Anno) ->
range(Document, Anno).

-spec diagnostic(
string(),
string(),
Expand Down