File tree 1 file changed +12
-3
lines changed
apps/language_server/lib/language_server/providers
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ defmodule ElixirLS.LanguageServer.Providers.Completion do
20
20
# Lower priority is shown higher in the result list
21
21
:priority ,
22
22
:tags ,
23
- :command
23
+ :command ,
24
+ { :preselect , false }
24
25
]
25
26
26
27
@ func_snippets % {
@@ -163,7 +164,9 @@ defmodule ElixirLS.LanguageServer.Providers.Completion do
163
164
detail: "keyword" ,
164
165
insert_text: "do\n $0\n end" ,
165
166
tags: [ ] ,
166
- priority: 0
167
+ priority: 0 ,
168
+ # force selection over other longer not exact completions
169
+ preselect: true
167
170
}
168
171
169
172
[ item | completion_items ]
@@ -978,9 +981,15 @@ defmodule ElixirLS.LanguageServer.Providers.Completion do
978
981
insert_text_format ( :snippet )
979
982
else
980
983
insert_text_format ( :plain_text )
981
- end
984
+ end ,
982
985
}
983
986
987
+ json = if item . preselect do
988
+ Map . put ( json , "preselect" , true )
989
+ else
990
+ json
991
+ end
992
+
984
993
# deprecated as of Language Server Protocol Specification - 3.15
985
994
json =
986
995
if Keyword . get ( options , :deprecated_supported , false ) do
You can’t perform that action at this time.
0 commit comments