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

Disabling deno-ts(80006) #27353

Closed
harrysolovay opened this issue Dec 13, 2024 · 5 comments · Fixed by #27373
Closed

Disabling deno-ts(80006) #27353

harrysolovay opened this issue Dec 13, 2024 · 5 comments · Fixed by #27373
Labels
lsp related to the language server suggestion suggestions for new features (yet to be agreed) upstream Changes in upstream are required to solve these issues

Comments

@harrysolovay
Copy link

I often see this diagnostic in functions that return a promise:

deno-ts(80006)

I believe this is a mistake / should be something end developers can disable.

For instance, the following JS is valid:

function completeText(messages: string[]): Promise<string> {
  return chat.completions.create({ messages }).then(unwrapChoice)
}

However, I still see the diagnostic. And it suggests the following refactor:

function completeText(messages: string[]): Promise<string> {
  const completion = await chat.completions.create({ messages })
  return unwrapChoice(completion)
}

I prefer the initial version. Can I / how might I get the Deno LS to stop including this diagnostic?

@dsherret
Copy link
Member

Do you have a reproduction? It shouldn't error for the first one.

@dsherret dsherret added the needs info needs further information to be properly triaged label Dec 13, 2024
@harrysolovay
Copy link
Author

harrysolovay commented Dec 13, 2024

Yes: the source code can be found here.

Screenshot 2024-12-13 at 1 56 05 PM

@dsherret
Copy link
Member

Ah, I didn't realize this was just a suggestion from TypeScript. I think we just need a way to disable or filter out certain typescript suggestions (related https://stackoverflow.com/a/77265400/188246). Thoughts, @nayeemrmn?

@dsherret dsherret added suggestion suggestions for new features (yet to be agreed) lsp related to the language server and removed needs info needs further information to be properly triaged labels Dec 13, 2024
@nayeemrmn nayeemrmn added the upstream Changes in upstream are required to solve these issues label Dec 13, 2024
@nayeemrmn
Copy link
Collaborator

Seems like an upstream issue. Is there a way of disabling it with ts server that doesn't work here?

@nayeemrmn
Copy link
Collaborator

#27373 will implement "typescript.suggestionActions.enabled": false which is TypeScript's recommended solution to this: microsoft/vscode#61326 (comment). It seems to work pretty well, but a more granular setting is requested upstream at microsoft/TypeScript#28825. That doesn't exist yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lsp related to the language server suggestion suggestions for new features (yet to be agreed) upstream Changes in upstream are required to solve these issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants