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 & deno check differ #28045

Closed
NfNitLoop opened this issue Feb 11, 2025 · 5 comments
Closed

LSP & deno check differ #28045

NfNitLoop opened this issue Feb 11, 2025 · 5 comments
Labels
bug Something isn't working correctly lsp related to the language server

Comments

@NfNitLoop
Copy link

The LSP (or, well, the Deno VSCode plugin) and deno check differ about whether these types are correct:

// OK in LSP & `deno check`:
function myFetch(input: FetchParams[0], init?: RequestInit) {
    const signal = init?.signal
}

// OK in `deno check`, but not LSP.
function myFetch2(input: FetchParams[0], init?: FetchParams[1]) {
    // LSP says: Property 'signal' does not exist on type 'RequestInit'
    const signal = init?.signal
}

type FetchParams = Parameters<typeof fetch>

Versions:

> deno --version
deno 2.1.9 (stable, release, aarch64-apple-darwin)
v8 13.0.245.12-rusty
typescript 5.6.2
Identifier
denoland.vscode-deno
Version
3.43.3
Last Updated
2025-01-30, 15:23:31
@marvinhagemeister
Copy link
Contributor

Not able to reproduce this. When you hover over the error shown in vscode, does the error code at the end have the format deno-ts(<number>) or ts-(<number>)? If it's the latter than the Deno LSP is not active in the project. The extension activates itself for a project when a deno.json is present or the Deno: Enable command is run from the vscode command palette.

@marvinhagemeister marvinhagemeister added the needs info needs further information to be properly triaged label Feb 11, 2025
@NfNitLoop
Copy link
Author

Yep, the error is from deno-ts(2339).

Image

@NfNitLoop
Copy link
Author

NfNitLoop commented Feb 11, 2025

Hmm, if I take my minimal reproduction (min.ts) and put it in a fresh Deno project, I can't reproduce it either.

The non-minimal reproduction can be found here:

https://github.com/diskuto/rss-sync/blob/v2.0.2/src/aborter.ts#L25

(update): One tip for reproduction -- the LSP may initially show that all types pass. Go to the above line, delete the last character and re-add it to consistently trigger the behavior.

@marvinhagemeister marvinhagemeister added bug Something isn't working correctly lsp related to the language server and removed needs info needs further information to be properly triaged labels Feb 11, 2025
@nayeemrmn
Copy link
Collaborator

Hmm I can reproduce in 2.1.9 but looks like it's already been fixed in main. @NfNitLoop Can you try deno upgrade --canary to check?

@NfNitLoop
Copy link
Author

> deno upgrade --canary
Current Deno version: v2.1.9
Looking up canary version

Found latest canary version 795ecfdca60d22183babdf887f7f66500c3983b3

👍 Confirmed, that fixes it for me too. Glad it was fixed so quickly. Sorry about the duplicate report!

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

No branches or pull requests

3 participants