diff --git a/apps/elixir_ls_debugger/lib/debugger/server.ex b/apps/elixir_ls_debugger/lib/debugger/server.ex index 66d7b5f2c..9c489c09c 100644 --- a/apps/elixir_ls_debugger/lib/debugger/server.ex +++ b/apps/elixir_ls_debugger/lib/debugger/server.ex @@ -681,10 +681,11 @@ defmodule ElixirLS.Debugger.Server do } end) - env = %ElixirSense.Providers.Suggestion.Complete.Env{vars: vars} + env = %ElixirSense.Core.State.Env{vars: vars} + metadata = %ElixirSense.Core.Metadata{} results = - ElixirSense.Providers.Suggestion.Complete.complete(prefix, env) + ElixirSense.Providers.Suggestion.Complete.complete(prefix, env, metadata) |> Enum.map(&ElixirLS.Debugger.Completions.map/1) {%{"targets" => results}, state} diff --git a/apps/language_server/lib/language_server/experimental/provider/handlers/find_references.ex b/apps/language_server/lib/language_server/experimental/provider/handlers/find_references.ex index b46c334ec..7b464a9a0 100644 --- a/apps/language_server/lib/language_server/experimental/provider/handlers/find_references.ex +++ b/apps/language_server/lib/language_server/experimental/provider/handlers/find_references.ex @@ -32,6 +32,9 @@ defmodule ElixirLS.LanguageServer.Experimental.Provider.Handlers.FindReferences end end) |> Enum.reverse() + # ElixirSense returns references from both compile tracer and current buffer + # There may be duplicates + |> Enum.uniq() response = Responses.FindReferences.new(request.id, references) Logger.info("found #{length(references)} refs") diff --git a/apps/language_server/lib/language_server/providers/hover.ex b/apps/language_server/lib/language_server/providers/hover.ex index cd1071b44..c837aee34 100644 --- a/apps/language_server/lib/language_server/providers/hover.ex +++ b/apps/language_server/lib/language_server/providers/hover.ex @@ -48,7 +48,7 @@ defmodule ElixirLS.LanguageServer.Providers.Hover do ) end - defp contents(%{docs: markdown}, subject, project_dir) do + defp contents(markdown, subject, project_dir) do %{ kind: "markdown", value: add_hexdocs_link(markdown, subject, project_dir) diff --git a/apps/language_server/lib/language_server/providers/references.ex b/apps/language_server/lib/language_server/providers/references.ex index dcc33cd79..7ec2154b3 100644 --- a/apps/language_server/lib/language_server/providers/references.ex +++ b/apps/language_server/lib/language_server/providers/references.ex @@ -26,6 +26,9 @@ defmodule ElixirLS.LanguageServer.Providers.References do |> build_reference(uri, text) end) |> Enum.filter(&(not is_nil(&1))) + # ElixirSense returns references from both compile tracer and current buffer + # There may be duplicates + |> Enum.uniq() end) end diff --git a/dep_versions.exs b/dep_versions.exs index 5ea6aa5a5..07b25f687 100644 --- a/dep_versions.exs +++ b/dep_versions.exs @@ -1,5 +1,5 @@ [ - elixir_sense: "3aea5e26d71d00c160033bd86451b11a69424b9d", + elixir_sense: "a495a9bfed95de84ee49f0f4f3c5768ae24d43b2", dialyxir_vendored: "7e908b4d760c7329046e0ee3076be9156cd784e1", jason_v: "c81537e2a5e1acacb915cf339fe400357e3c2aaa" ] diff --git a/mix.lock b/mix.lock index 0016c793c..8073925cc 100644 --- a/mix.lock +++ b/mix.lock @@ -2,7 +2,7 @@ "benchee": {:hex, :benchee, "1.1.0", "f3a43817209a92a1fade36ef36b86e1052627fd8934a8b937ac9ab3a76c43062", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:statistex, "~> 1.0", [hex: :statistex, repo: "hexpm", optional: false]}], "hexpm", "7da57d545003165a012b587077f6ba90b89210fd88074ce3c60ce239eb5e6d93"}, "deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"}, "dialyxir_vendored": {:git, "https://github.com/elixir-lsp/dialyxir.git", "7e908b4d760c7329046e0ee3076be9156cd784e1", [ref: "7e908b4d760c7329046e0ee3076be9156cd784e1"]}, - "elixir_sense": {:git, "https://github.com/elixir-lsp/elixir_sense.git", "3aea5e26d71d00c160033bd86451b11a69424b9d", [ref: "3aea5e26d71d00c160033bd86451b11a69424b9d"]}, + "elixir_sense": {:git, "https://github.com/elixir-lsp/elixir_sense.git", "a495a9bfed95de84ee49f0f4f3c5768ae24d43b2", [ref: "a495a9bfed95de84ee49f0f4f3c5768ae24d43b2"]}, "erl2ex": {:git, "https://github.com/dazuma/erl2ex.git", "244c2d9ed5805ef4855a491d8616b8842fef7ca4", []}, "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, "jason_v": {:git, "https://github.com/elixir-lsp/jason.git", "c81537e2a5e1acacb915cf339fe400357e3c2aaa", [ref: "c81537e2a5e1acacb915cf339fe400357e3c2aaa"]},