HLS should always respond to resolve
requests
#4473
Labels
component: ghcide
component: hls-plugin-api
type: bug
Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
We have multiple reports, where
resolve
requests (such ascompletion/resolve
andcodeAction/resolve
) are rejected by HLS since the_data
field of the respective LSP feature has not been populated by HLS. This makes sense, as we only supportresolve
for certain kinds ofCodeAction
/Completions
, when they contain particularly expensive properties, such as documentation or non-local type signatures.In #4463, I added a plaster for completions, deciding to always add the
_data
field, which allows our run-time system to resolve such requests to the completion plugin.While this should work for completions, we have the same issue with completions provided by the
hls-cabal-plugin
, which serves completions for.cabal
files.Moreover, multiple plugins provide
CodeAction
s but not necessarilyCodeAction/resolve
handlers, causing HLS to reject such requests.This behaviour is troublesome, as vim clients (maybe emacs as well) seemingly show such rejections prominently in the UI, perhaps even outright not applying already present Codefixes.
The solution might be something like this:
If the
_data
field isNothing
we do not try to resolve a*/resolve
request to a specific plugin, but always return the request data unchanged. If the_data
field is provided, we try to thread the*/resolve
request to the plugin which presumably handles the request.We only reject the request, if the
_data
field is given, but no plugin owner can be determined.This behaviour differs from the current behaviour only regarding how to handle
_data = Nothing
case, in which case we rejected the request.Linked issues #4467, #4451
The text was updated successfully, but these errors were encountered: