-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
LSP enablePaths option not working in non-VSCode editor #19802
Comments
There is a test for this exact scenario here: deno/cli/tests/integration/lsp_tests.rs Lines 1084 to 1093 in 9d5f6f6
Why are all the forward slashes escaped in these values? Maybe it has something to do with that? https://gist.github.com/sgwilym/02f8787b39d4b6d0e580482ef0a14802#file-initialisation_rcp-json-L195 |
Yeah, I noticed that too, but as there was escaping in other parts of the initialisation options I assumed it was okay. Maybe it's not?! Which would be a pain, as the IDE's built-in client is escaping the values I pass through it whether I want that or not. |
It might not be an issue. I'm unsure and still looking into this. |
It seems like enablePaths doesn't work with absolute paths. Try providing just |
Oh, actually that looks to be a vscode_deno behaviour with not working with absolute paths: https://github.com/denoland/vscode_deno/blob/db25171806abe8d8807ca41f8d8237b68dd708a8/client/src/extension.ts#L105 (that's for supressing built-in ts diagnostics, which is specific to vscode_deno). I'm not sure what the issue here is with nova, but there is a passing test in the deno repo. Does Deno output any logs to stderr like "Unable to resolve a file path for |
Not that I can see. I get back a response indicating a successful initialisation. The form of the path doesn't seem to affect what happens. |
Interestingly, after the introduction of 1.36 and #19791 I can get this behaviour using the But this is exclusive, rather than the inclusive |
Same issue with helix, only exclude worked for me as well |
Lines 702 to 724 in a745549
@sgwilym It might work if you don't specify But I don't think we should ignore the root workspace settings if |
Fixes #19802. Properly respect when clients do not have the `workspace/configuration` capability, a.k.a. when an editor cannot provide scoped settings on request from the LSP. - Fix one spot where we weren't checking for the capability before sending this request. - For `enablePaths`, fall back to the settings passed in the initialization options in more cases. - Respect the `workspace/configuration` capability in the test harness client. See: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_configuration.
Thank you @nayeemrmn, looking forward to using this feature at last! |
@sgwilym Can you confirm on the |
I can confirm this works in helix now. |
@nayeemrmn Unfortunately I still seem to have the same problem. Sorry! Here is the initialisation request, with many variants of How the LSP is initialised is a bit out of my control, as my Deno extension uses Nova's built-in LSP client. So I may have to communicate with the devs for that editor to change how the LSP server is initialised. |
@sgwilym When testing, do you also have a nova config file which has |
@nayeemrmn My extension is responsible for providing the values of I went looking for {
"jsonrpc" : "2.0",
"id" : 8,
"method" : "workspace\/configuration",
"params" : {
"items" : [
{
"section" : "deno",
"scopeUri" : "file:\/\/\/Users\/gwil\/Projects\/nova-deno\/build.ts"
}
]
}
} So it seems like Nova is sending workspace/configuration requests for each file that's open, and this is overriding the |
Correct. You can disable that by turning off this capability, i.e. switching https://gist.github.com/sgwilym/02f8787b39d4b6d0e580482ef0a14802#file-initialisation_rcp-json-L20 to false. |
I'm trying to add support for the
enablePaths
option to my Deno extension for Nova.But it doesn't seem to matter how I pass the paths to the LSP upon initialisation —
src
,./src
,/Users/me/project/src
,file://Users/me/project/src
— the LSP keeps working on files outside of these paths.Here's a gist with the initialisation RPC call. As far as I can tell, this should work. Could some other option be messing with it?
Could this be something to do with Nova? I can see that its built-in LSP client is sending RPC calls like this for files outside of the enabled paths:
And even though this file is outside the enabledPaths, the Deno LSP server will send back a result:
Should it do that? Should it send back nothing?
The text was updated successfully, but these errors were encountered: