File tree 1 file changed +17
-0
lines changed
ghcide/src/Development/IDE/Plugin
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,23 @@ getCompletionsLSP ide plId
173
173
To allow the LSP client to reorder identifiers while preserving the relative ordering
174
174
of repeated occurrences we generate sortText values that include both the label and
175
175
an index denoting the relative order
176
+
177
+ EXAMPLE
178
+ We produce completions:
179
+ x -- local
180
+ y -- local
181
+ x -- global
182
+ y -- global
183
+
184
+ The LSP client decides to present:
185
+ y -- local
186
+ y -- global
187
+ x -- local
188
+ x -- global
189
+
190
+ This is fine if the LSP client thinks that 'y' is more relevant than 'x'.
191
+ We are OK with that choice since the local options are presented before the global ones
192
+
176
193
-}
177
194
orderedCompletions :: [CompletionItem ] -> [CompletionItem ]
178
195
orderedCompletions = zipWith addOrder [0 .. ]
You can’t perform that action at this time.
0 commit comments