-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Loading React types cripples LSP performance #23702
Comments
Hello! I started looking into this and I can definitely reproduce the issue (thanks for the nice and small repo illustrating the problem!) The majority of the time is being spent in the typescript compiler, particularly typechecking the call to I don't have a proper fix at this time, but as a workaround you can add an |
Version: Deno 1.43.1
I was excited by the snappy performance of the LSP in VS Code for version 1.43 however as soon as you load React's types the 10+ second processing time resumes. This is the culprit from what I can tell:
// @deno-types="npm:@types/react@18"
Removing that will resume the snappy performance, but neither Deno nor VS Code know what React's types are.
I am unable to get the LSP to recognize the types this way:
import type {} from "npm:@types/react"
I've created a sample repo for reference: https://github.com/chrisabrams/lsp-react-slow
I saw there is a new option
jsxImportSourceTypes
from #23419 for 1.43 but when I tried adding that, VS Code was not aware of the types. For example here is what I did:With the
import_map.json
referencing their respectivenpm
package.Here is the language server performance:
Performance (last 3 000 entries)
The text was updated successfully, but these errors were encountered: