Skip to content

Commit

Permalink
handle activeParameter override on signature
Browse files Browse the repository at this point in the history
Completes fix for #994
  • Loading branch information
lukaszsamson committed Oct 2, 2023
1 parent 3fe374e commit 1e9a1dc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,23 @@ defmodule ElixirLS.LanguageServer.Providers.SignatureHelp do
{:ok, response}
end

defp signature_response(%{documentation: documentation, name: name, params: params, spec: spec}) do
defp signature_response(
%{documentation: documentation, name: name, params: params, spec: spec} = signature
) do
params_info = for param <- params, do: %{"label" => param}

label = "#{name}(#{Enum.join(params, ", ")})"
response = %{"label" => label, "parameters" => params_info}

response =
case signature do
%{active_param: active_param} ->
Map.put(response, "activeParameter", active_param)

_ ->
response
end

case {spec, documentation} do
{"", ""} ->
response
Expand Down
2 changes: 1 addition & 1 deletion dep_versions.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[
elixir_sense: "a9ae8bc1bd4b99957b68512eb364513898826a30",
elixir_sense: "d2e39a51542dec75932a20cdf430acff24896087",
dialyxir_vendored: "d50dcd7101c6ebd37b57b7ee4a7888d8cb634782",
jason_v: "c81537e2a5e1acacb915cf339fe400357e3c2aaa",
erl2ex_vendored: "073ac6b9a44282e718b6050c7b27cedf9217a12a",
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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", "d50dcd7101c6ebd37b57b7ee4a7888d8cb634782", [ref: "d50dcd7101c6ebd37b57b7ee4a7888d8cb634782"]},
"elixir_sense": {:git, "https://github.com/elixir-lsp/elixir_sense.git", "a9ae8bc1bd4b99957b68512eb364513898826a30", [ref: "a9ae8bc1bd4b99957b68512eb364513898826a30"]},
"elixir_sense": {:git, "https://github.com/elixir-lsp/elixir_sense.git", "d2e39a51542dec75932a20cdf430acff24896087", [ref: "d2e39a51542dec75932a20cdf430acff24896087"]},
"erl2ex_vendored": {:git, "https://github.com/elixir-lsp/erl2ex.git", "073ac6b9a44282e718b6050c7b27cedf9217a12a", [ref: "073ac6b9a44282e718b6050c7b27cedf9217a12a"]},
"erlex_vendored": {:git, "https://github.com/elixir-lsp/erlex.git", "82db0e82ee4896491bc26dec99f5d795f03ab9f4", [ref: "82db0e82ee4896491bc26dec99f5d795f03ab9f4"]},
"jason_v": {:git, "https://github.com/elixir-lsp/jason.git", "c81537e2a5e1acacb915cf339fe400357e3c2aaa", [ref: "c81537e2a5e1acacb915cf339fe400357e3c2aaa"]},
Expand Down

0 comments on commit 1e9a1dc

Please sign in to comment.