-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for completions in debugger (#679)
* fix typo * warn about not supported client options * Add support for debugger completions
- Loading branch information
1 parent
a0e60f1
commit ba6252f
Showing
14 changed files
with
209 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
defmodule ElixirLS.Debugger.Completions do | ||
# type CompletionItemType = 'method' | 'function' | 'constructor' | 'field' | ||
# | 'variable' | 'class' | 'interface' | 'module' | 'property' | 'unit' | ||
# | 'value' | 'enum' | 'keyword' | 'snippet' | 'text' | 'color' | 'file' | ||
# | 'reference' | 'customcolor'; | ||
def map(%{ | ||
type: type, | ||
name: name, | ||
arity: arity, | ||
snippet: snippet | ||
}) | ||
when type in [:function, :macro] do | ||
%{ | ||
type: "function", | ||
label: "#{name}/#{arity}", | ||
text: snippet || name | ||
} | ||
end | ||
|
||
def map(%{ | ||
type: :module, | ||
name: name | ||
}) do | ||
text = | ||
case name do | ||
":" <> rest -> rest | ||
other -> other | ||
end | ||
|
||
%{ | ||
type: "module", | ||
label: name, | ||
text: text | ||
} | ||
end | ||
|
||
def map(%{ | ||
type: :variable, | ||
name: name | ||
}) do | ||
%{ | ||
type: "variable", | ||
label: name | ||
} | ||
end | ||
|
||
def map(%{ | ||
type: :field, | ||
name: name | ||
}) do | ||
%{ | ||
type: "field", | ||
label: name | ||
} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters