-
-
Notifications
You must be signed in to change notification settings - Fork 389
!!MISSING: command!! is intermittently displayed instead of type class function signatures #3827
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
Comments
Ok, have made some more investigations and found this in the server logs (verbose):
I'm not able to reproduce it consistently yet but the issue seems to occur more often when I constantly scroll the source from top to bottom and back. |
Here is a longer part of the log. I'm not sure but it seems that the issue occurs in combination of:
|
cc @joyfulmantis , this seems like a resolve issue? |
I believe this is a vscode issue. We can't respond to stale resolve requests, and in those cases we respond with the correct error code. Instead of displaying no command vscode shouldn't display the lens at all. |
I've been able to reproduce it on Intel x86_64 / Ubuntu also. I can open an issue on vscode-haskell if you think it's a problem on the client side. |
I believe the place where you want to open an issue is either vscode's official language server client package or the vscode repository . |
Closing as we believe this is not our fault and needs to be raised in vscode. |
I'm unsure about this. Maybe we should instead return the original item without new fields filled in in this case? It's unclear. |
I doubt doing that would fix it in that case, as it still would be a lens without a command |
I guess you're right. The only thing we could do would be to back out the resolve support, or somehow make it possible for stale resolve requests to be more likely to work. |
I found the corresponding code in |
@michaelpj Do we need to remove resolve here or rework it to be more successful because of vscodes's position vis a vis resolve failure? microsoft/vscode#197643 (comment) |
I don't know what to do tbh. It seems like their position is "resolve should be very reliable", and I'm not sure that that's something we can promise... FWIW, I haven't observed this happening to me much (but then I use emacs not vscode, and I'm not sure how emacs deals with it). Perhaps we can leave this open and see if we get more people complaining. One thing we might want to do is offer some configuration options about whether to use resolve. That's somewhat consistent with what we do for other features, you can generally e.g. turn off code lenses for a plugin, maybe you should also be able to turn off code-lens-resolve 🤔 That way at least if it's really misbehaving for people they can turn it off... |
Another thought: could we use a more robust key for some of the resolve functions? e.g. for type lenses we could probably use something like the combination of line-in-file and binding-name to identify a lens target. Then when we resolve we can get the fresh information about the file, see if there is still a binding with that name on that line, and if so continue resolving it. WDYT @joyfulmantis ? |
I'm quite new to the Haskell community. But it sounds like it's actually "reloading" these lenses. At least I now know what is actually happening when I see |
I think that is an idea we can explore. I think the reason why I originally chose to have these transient keys that we currently have, was to avoid having to process information multiple times. However, we could keep the current keys, and then add more information that allows us to compute the new lens if the key is stale. |
I guess I was hoping that we still wouldn't have to redo work? We can still use basically the same structure, I'm really just proposing a different key type. i.e. what if we actually just used
Generally we don't have a good way of doing this in a way that's actually visible to users. For now, I think having something visible on the issue tracker is the best thing we can do... |
Your environment
Which OS do you use?
Macbook Air M2 15" (Ventura 13.6)
Intel x86_64 (Ubuntu 20.04.6 LTS)
Same issue on both systems.
Which version of GHC do you use and how did you install it?
Installed with
ghcup
:How is your project built (alternative: link to the project)?
https://github.com/konnik/haskell-json-parser
Which LSP client (editor/plugin) do you use?
VSCode + haskell.haskell
Which version of HLS do you use and how did you install it?
Installed by
ghcup
Have you configured HLS in any way (especially: a
hie.yaml
file)?no
Steps to reproduce
Really don't know how to reproduce it. It's very intermittent and resolves itself.
Expected behaviour
The code lens (don't know if this is the correct termiology) in vscode should show the type class signatures on my instance:
Actual behaviour
If i click on the text "!!MISSING: command!!" the error message "command 'missing' not found" is shown in bottom right of vscode
Debug information
Some things from the logs. Don't know if its relevant:
The text was updated successfully, but these errors were encountered: