Skip to content
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 doesn't respect deno.unstable (on startup) #21167

Closed
irbull opened this issue Nov 11, 2023 · 2 comments · Fixed by #21170
Closed

lsp doesn't respect deno.unstable (on startup) #21167

irbull opened this issue Nov 11, 2023 · 2 comments · Fixed by #21170
Assignees
Labels
bug Something isn't working correctly lsp related to the language server

Comments

@irbull
Copy link
Contributor

irbull commented Nov 11, 2023

While investigating (#21159) is seems there is another case where the LSP doesn't respect the unstable flag. This is unrelated to the /// <reference no-default-lib="true" /> directive.

Steps to reproduce:

  1. Start a new instance of VSCode
  2. Initialize a Deno workspace (with unstable API)
  3. Create a file with the following Deno.dlopen and save it
  4. It will complain that dlopen is an unstable API.

If you restart the LSP, the setting sticks. Seems like a timing issue on startup.

I've attached a screengrab.

unstable

@nayeemrmn nayeemrmn added bug Something isn't working correctly lsp related to the language server labels Nov 11, 2023
@nayeemrmn nayeemrmn self-assigned this Nov 11, 2023
@irbull
Copy link
Contributor Author

irbull commented Nov 12, 2023

I spent some time today with both the LSP server and the VSCode extension looking at this issue. Here is what seems to be happening:

  1. When you Initialize the Deno Workspace 3 things are set (deno.enable, deno.lint & deno.unstable).
  2. These are set sequentially through await config.update
  3. The first of these deno.enable causes the LSP to restart
  4. When the other settings are applied, the update_tsconfig is not called
  5. If you change the settings file manually, it will be picked up by the filewatcher.

@irbull
Copy link
Contributor Author

irbull commented Nov 12, 2023

Opps, sorry @nayeemrmn I missed that you had a PR here when I commented. Yes, that looks right. I pulled it down and it fixes the issue.

I'm not sure I understand the changes to the tests and how they relate to this issue, but I'll leave a comment on the PR about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly lsp related to the language server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants