Skip to content

Commit ea543d4

Browse files
committed
return detail in debugger completions
Added in DAP 1.53
1 parent 5ef73a5 commit ea543d4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

apps/elixir_ls_debugger/lib/debugger/completions.ex

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ defmodule ElixirLS.Debugger.Completions do
1212
when type in [:function, :macro] do
1313
%{
1414
type: "function",
15+
detail: Atom.to_string(type),
1516
label: "#{name}/#{arity}",
1617
text: snippet || name
1718
}
1819
end
1920

2021
def map(%{
2122
type: :module,
23+
subtype: subtype,
2224
name: name
2325
}) do
2426
text =
@@ -29,6 +31,7 @@ defmodule ElixirLS.Debugger.Completions do
2931

3032
%{
3133
type: "module",
34+
detail: if(subtype != nil, do: Atom.to_string(subtype)),
3235
label: name,
3336
text: text
3437
}
@@ -46,10 +49,18 @@ defmodule ElixirLS.Debugger.Completions do
4649

4750
def map(%{
4851
type: :field,
52+
subtype: subtype,
4953
name: name
5054
}) do
55+
detail =
56+
case subtype do
57+
:struct_field -> "struct field"
58+
:map_key -> "map key"
59+
end
60+
5161
%{
5262
type: "field",
63+
detail: detail,
5364
label: name
5465
}
5566
end

0 commit comments

Comments
 (0)