Skip to content

Commit

Permalink
deduplicate rendered messages
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Dec 21, 2023
1 parent f6fc44f commit be46796
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions apps/language_server/lib/language_server/diagnostics.ex
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ defmodule ElixirLS.LanguageServer.Diagnostics do
}
end
|> Enum.sort_by(& &1["range"]["start"])
|> Enum.dedup()

message = %{
"uri" => uri,
Expand Down
6 changes: 3 additions & 3 deletions apps/language_server/lib/language_server/server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1626,9 +1626,9 @@ defmodule ElixirLS.LanguageServer.Server do
# document open but was closed when build was triggered
# document could have been edited
# combine diagnostics
# they can be duplicated but it is not trivial to deduplicate
{parser_diagnostics_document_version,
Enum.uniq(parser_diagnostics ++ build_and_dialyzer_diagnostics)}
# they can be duplicated but it is not trivial to deduplicate here
# instead we deduplicate on publish with rendered messages
{parser_diagnostics_document_version, parser_diagnostics ++ build_and_dialyzer_diagnostics}

true ->
# document closed
Expand Down

0 comments on commit be46796

Please sign in to comment.