@@ -207,6 +207,30 @@ data CompletionResolveData
207
207
-- which present on some clients (e.g., emacs) as an error message.
208
208
-- See https://github.com/haskell/haskell-language-server/issues/4451 for the issue that
209
209
-- triggered this change.
210
+ --
211
+ -- Clients (i.e., VSCode) request completion items to be resolved if
212
+ -- we advertise capabilities for it.
213
+ -- However, HLS used to resolve completion items for only a subset of completion items,
214
+ -- and reject requests for which there is no additional info available,
215
+ -- e.g. function local variables don't have any docs or similar, so we didn't
216
+ -- respond to "completion/resolve" requests for these completion items.
217
+ -- We rejected these requests by *not* adding `_data_` (i.e., `_data_ = Nothing),
218
+ -- which caused HLS to reject "completion/resolve" requests, as we can only thread
219
+ -- requests to the appropriate plugin if this `_data_` field is populated and
220
+ -- can be deserialised.
221
+ -- Since this `_data_` was missing, we rejected the request with:
222
+ --
223
+ -- @
224
+ -- Error processing message (error "No plugins are available to handle this SMethod_CompletionItemResolve request.
225
+ -- Plugins installed for this method, but not available to handle this request are:
226
+ -- ghcide-completions does not handle resolve requests for (unable to determine resolve owner)).").
227
+ -- @
228
+ --
229
+ -- However, this proved to be annoying as some clients (i.e., emacs) display
230
+ -- our request rejection prominently in the user interface.
231
+ -- As this is annoying, we insert this "dummy" data 'NothingToResolve',
232
+ -- which allows HLS to thread the "completion/resolve" request to this plugin.
233
+ -- The plugin then simply returns the original 'CompletionItem',
210
234
| CompletionResolveData
211
235
-- ^ Data that we use to handle "completion/resolve" requests.
212
236
{ itemFile :: Uri
0 commit comments