-
Notifications
You must be signed in to change notification settings - Fork 8
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
Known issues #26
Comments
Should be fine to just document and require clients to implement it. I'm thinking that we'll probably just support that command in ST as we already support
You mean pull diagnostics model? |
Agreed. I've also seen that many clients support client side commands.
Yes, currently only |
Example: "Move to a new file" code action. Maybe that can just be hidden until figured out how to resolve |
I doubt that the fail case you encountered is not the one I intended to describe, I think I need to expand on it here. The problem involved there is that some code actions carry complex additional data (like action context, last request position, etc. Also see this for a real example) which is required for their resolve in the extension, in VSCode it relies on the object referential equality to directly access that information while we need to serialize all of them to the To circumvent that, the same working mechanism as VSCode that depends on the object referential equality is incorporated here so that we do not need to care about serialization. Every result of completion and code action is cached on server side, and the {
providerId: 0,
index: 1, // the index of this item in the last response
cacheId: 2, // the cache id for the response contains this item
} On the resolve, the item entity is actually retrieved from the cache regardless of the actual passed item (code action). But to prevent from the limitless expansion of cache, a hard limit of cache size is set, which means that if an item is considered staled and removed on the server, the client won't get an expected response for its resolve. So generally, I don't think that the issue involved here is special to any kind of code action; and your mentioned case is possibly caused by other factors. "Move to new file" action is in the scope of support, a concrete example of its non-functioning is appreciated and worth deeper investigation. |
Your comment inspired me to do this optimization in typescript-language-server - typescript-language-server/typescript-language-server#768 though mostly due to potential performance gain rather than issue due to equality checks since I haven't noticed this being a problem. I don't see where this equality issue could come up since |
I think this project may be the one that is the closest to achieving the "Move to file" code action. For example, I think it is farther along in support compared to https://github.com/pmizio/typescript-tools.nvim which maybe a while ago was superior to tsserver via nvim-lspconfig, but, from my testing today, typescript-tools offers nothing new (in particular not providing "move to file"). I looked into the source code of vscode and found that "move to file" is provided by the exact vscode ts extensions which you're patching here, so it is not a part of tsserver as I originally thought. Then I learned through this issue that sadly "move to file" is disabled. I would like to understand more about what we would need to implement to achieve "Move to file". It is my holy grail right now. I am currently building a completely independent software development paradigm and I've been able to get very far on a simple treesitter foundation and coding it all up in typescript. Hence I am neck deep in typescript right now and looking at advanced typescript refactoring automations to help me progress, and I am loathe to fire up VSCode just in order to use "move to file"... but I will this if I have to. And I will reimplement "move to file" on my own in my metaprogramming tool i'm building, also, if I have to (and go ahead and try to do the same on all the other supported languages as well). Another thing that i'm confused about right now is I don't get why things like codelens (isn't this just about finding references?) and diagnostics are "not implemented" or "not complete" and yet I've been building a very complex code base using bone standard tsserver obtained with mason and nvim-lspconfig and it's been completely reliable and comprehensive in fetching diagnostics and references... This makes me worry that if by some miracle we get "move to file" working, once I switch over, i'll lose references and diagnostics... |
@unphased In the implementation in VSCode, the calls to VSCode apis For diagnostics feature: what is not implemented is the pull model, while the publish model should work normally. The missing support for the former one doesn't matter much currently. For code lens feature: it is the |
Thanks for summarizing. That is very helpful. I agree that without client LSP support, there is no clear path forward. However, I am certain that for something like "move to file" the juice will be worth the squeeze even by creating a nonstandard pathway (e.g. in nvim-vtsls) through which to implement the support. After all we just need a way to communicate a target path for this code action and that can be done with a telescope or fzf or any other file picker. Do you think that's a reasonable description or am I grossly oversimplifying the scope of the problem? I can see that probably the way vscode implements this one is with some significant quantity of back and forth logic (client requests code action, server sends query for file, client responds with presentation of file picking gui, sends the user choice asynchronously, to which server responds with a set of refactor edits) but the happy path here could be implemented by proactively asking for a target file the moment we pick this particular code action. Standard conforming solutions are almost always chicken egg problems. It's easy if you already have a viable hen or egg, but otherwise somebody has to step up and be a mad scientist to bootstrap the thing. A Frankenstein implementation that gets the job done is often the most practical way to motivate standards to catch up to the needs of users. The fact that vscode has already implemented move to file for typescript makes it the path of least resistance for implementing this in neovim for typescript. I see this as the best way to motivate the LSP standard toward expanding the protocol, which will in turn open the door to this scale of automation across LSPs for other languages. This seems appropriate, given tsserver was what gave birth to LSP in the first place. |
Hey @yioneko! I see that JSX tag autoclose is not yet implemented and the feature branch for it has gone stale and is approaching 9 months since a commit. Just wondering what's currently holding this feature back, and where it stands on the priority list? |
@josevelaz I was waiting for the finalization of LSP 3.18 which includes support for snippet in workspace edit to provide the feature in a standard way. The progress on it stalled because the last time I checked, there was no client capable of handling it and I need a capable client for testing. I might revisit it to see if we can bring the feature soon. Thanks for reminding! |
textDocument/diagnostic
orworkspace/diagnostic
are not implemented yet.completionItem/resolve
andcodeAction/resolve
will fail in some cases.editor.action.showReferences
, which only exists in vscode. Unfixable on server side currently.The text was updated successfully, but these errors were encountered: