-
-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HLS should always respond to resolve
requests
#4473
Comments
cc @michaelpj, @joyfulmantis, do you think this makes sense? |
Yes, I agree with something like this. We didn't completely think this through: while we have differing levels of support for So what to do? I can see two options:
I think the implementation looks pretty similar: in both cases we'll need a catch-all handler, it's just that for option 2 it will decide whether or not to return an error depending on whether or not the item has a |
I have a POC for (2), will send the PR tomorrow. |
did the POC solve the issue? |
@Sivecano Yes, now we just need a release with the changes, which likely will coincide with the release of GHC 9.6.7 and 9.12.2 (the latter was released last friday) |
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: