-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
feat(lsp): Add textDocument/implementation #9071
feat(lsp): Add textDocument/implementation #9071
Conversation
f39f172
to
7662488
Compare
7662488
to
c496405
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice contribution... Thank you.
LGTM
We need to enable "ignoring" the same results from the built in language service in the vscode plugin: denoland/vscode_deno#301. I can do that if you wish, but also feel free to raise a PR for that.
target_selection_range, | ||
}); | ||
if let Some(link) = di | ||
.document_span |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 💯
Can you do that instead of me please? I unfortunately have exams this and next week. |
@matsujika when opening a remote file with textDocument/implementation, the server now returns an URI with a strange scheme:
I would expect |
|
This seems to require client glue code for each separate client, which defeats the purpose of LSP. https://github.com/denoland/vscode_deno/blob/34b7130f3b810a635f88dd88e5927f3faaa1bffa/client/src/lsp_extensions.ts Handling custom URI schemes is something we can account for I guess. |
@rwols far from it. There is always still some client glue no matter what, for commands. Just passing the raw scheme would cause lots of other client issues, because for remote modules. Like you don't require extensions on URLs so how does the editor know the media type to route to the correct extension. By moving it to a custom scheme it is 100% clear to the editor who additional requests and notifications should go through. You could maybe argue it is a gap in the LSP protocol, but the protocol is designed to have extensions. Those lsp extensions are documented in the README for the Deno LSP: https://github.com/denoland/deno/tree/main/cli/lsp |
The choice could have been made to apply the following strategy:
Not every client has the notion of a "virtual text document". |
@Rowls that does not work... we previously tried that in the v2 branch of the extension. URLs don't make great file systems paths, especially when accounting for queries, also consider data URLs which Deno supports. That means you have to hash the filename and then the hashed file name doesn't look anything like the source file, so you get these really ugly documents. The virtual document strategy is far more robust. Would be glad to work with any team trying to build a client for Deno LSP to understand how virtual text document support is critical, as remote modules are virtual documents that can be opened in the editor. |
@kitsonk https://github.com/sublimelsp/LSP-Deno with respect to |
@rwols Could you make a new issue for that? It is hard to keep track of things if they are just posted as comments on old PRs :-) |
Part of #8643