Typescript inspections sometimes unreliable and/or slow
There are times when TS inspections are slow -- meaning when I fix an error, WS can take several seconds or even longer to clear the error.
Other times, it seems like it never wants to clear the error. I have to delete the code I just typed, type it again, then WS is satisfied.
Still other times, there are false positives -- WS doesn't report a TS error when it should have.
Has anyone else noticed this? Is this a WS or TS issue?
请先登录再写评论。
Hi,
I am facing the same issue(slowness in autocomplete(~10 sec) and in inspection/clearing errors) with version 2018.2.1. I tried the following things but no luck -
Please help. Other developers in the team are also facing the same issue.
I am experiencing this also Webstorm 2018.2.5. It is a bit frustrating to know that a quality tool has this kind of shortcoming, especially when there is a free alternative that is lightning fast. Please fix this.
This is still not resolved in IntelliJ 2018.2.5
The problem exists both for Windows and Ubuntu and it looks like it is a known issue for people who are using TS / Angular so they are just using VS Code instead.
Any updates about it? Checking types errors through IDE is still very slow.
Still in issue for me. Sometimes the parses messes up in the middle of a variable. So for
```
const someVar = 'blabla';
```
it might give me a warning that the variabl is not used only for `some` (which is not correct).
This issue started to appear since the latest update.
"My thinking now, considering the comments, is a slowliness introduced on large projects using Angular, especially when using HTML templates inside the .ts files."
It's not just Angular. We have a React project with about 45K LOC and I just measured how quickly the problems reported by Webstorm (2019.1.2) update compared to VS Code (1.34). One change I tested was 3 sec. vs. 1 sec., another one 15 sec. vs. 5 sec. (Admittedly, there's probably something wrong with my OS but it still seems like the percentage-wise performance difference is consistent)
Thank you, invalidating the caches helped a little bit. However, inspections, and clearing errors, is still sometimes slow/delayed. For example, when I make an update to an interface in a types file, then use those definitions in some code, it sometimes takes several seconds (20, 30, more?) to recognize that the type changed, and for the inspector to be happy again.
I'm on WS 2017.2.5. I'm using the typescript service with TS 2.6.2.
I just updated from 2018.1 --> 2018.1.5 and it seems to be fixed! Thank you so much. This is truly wonderful news!
Done.
@Neelabh, Could you provide a link to the reported ticket?
That was my original thinking too Nathan. However with for the same project, VSCode (relying on TS Language Service too) is much faster for type updates (display errors, ...) than Webstorm / IntelliJ. So it's the not the Language Service that is slow here. My thinking now, considering the comments, is a slowliness introduced on large projects using Angular, especially when using HTML templates inside the .ts files.
Though it's hard to find the exact culprit here, so I never took time to open a support ticket. I don't know what to put that could be useful to the devs, expect my "gut feeling".
Still unalterable slow on Webstorm 2022.1.3. Not the beefiest machine, and we use some of complex typescript features - but the codebase isn't huge. I appreciate that at some point you just have to throw more power at the problem or refactor the code to easier for the typescript service to analyze, but some diagnostic tips would be great. eg.: if webstorm detects that inspection result from the typesscript service is slow, it could ask to run some diagnostics. *Some* tooling for this surely exist?
https://github.com/microsoft/TypeScript/wiki/Performance
I have a problem with variable names not updating quickly when changed.
For example, if you change the name of a variable, or the name used in an import statement, you'll see "Unused import specifier xxx" over and over again with each keystroke.
I tried File -> Invalidates Caches, but that didn't help. This happens almost every time.
Settings -> Languages & Frameworks
TypeScript language service : checked
- Show project erros : checke
- Recompile on changes : checked
I am so stressed out.
I'm considering whether I shouldn't use IntelliJ anymore.
please try invalidating caches (File | Invalidate caches, Invalidate and restart) - does the issue persist?
Also, do you have typescript service enabled in Settings | Languages & Frameworks | TypeScript? if yes, what Typescript and IDE versions do you use?
Try changing Typescript version to the bundled one - does it help? Typescript 2.6 includes breaking API changes that cause problems using TSServer integration; issue is fixed in 2017.3
I have noticed this issue as well and it's quite a damper on productivity. I recently just updated webstorm to 2017.3.4 and typescript inspection times have gone from 5-10s (which I thought was really slow) to almost 20s. I've tried the following:
Any other ideas?
Try disabling typescript language service - does the issue persist?
The responsiveness of inspections is certainly better without the typescript service enabled. TSC service tends to take around 10s on my machine to report the simplest type error. Without the tsc service it's close to 5s.
Please try taking CPU snapshots - https://intellij-support.jetbrains.com/hc/en-us/articles/207241235-Reporting-performance-problems
also, what does your tsconfig.json look like?
https://imgur.com/a/Kg7F2 is the tsconfig.
How should I provide you cpu snapshots?
You can upload them to ftp://ftp.intellij.net/.uploads/ and let me know the file names
I uploaded them via the upload service. FTP was giving me some trouble. The zip file is named WS-173.4548.30_ryanquinn_26.02.2018_15.42.42.zip. Thank you!
Please can you provide the full tsconfig.json? What does the `'include': []` section look like?
your package.json, information about the project structure and screenshot of Typescript settings page would be also appreciated
I've uploaded the contents you've asked for under a zip file named 'webstorm_files_rquinn_2_28.zip'. I very much appreciate your time! Thank you for the help!
Please try moving "typescript" from "dependencies" to "devDependencies" in your package.json.
Also I'd suggest trying 2018.1 EAP (https://www.jetbrains.com/webstorm/eap/) - it includes some fixes in this area
Okay so I think I have a decent reproducible case where Jetbrains has major performance issues with Typescript but VS Code handles the exact same code with absolutely no problem. I'm hoping that this helps track down whatever is causing the significant performance problems with Jetbrains and Typescript.
The repo is https://github.com/kpdonn/kpd-router , it's just a messy personal repo I've been testing out some typescript ideas on so I'll give you exact step by step directions I used to reproduce the performance problem in IntelliJ and then steps to show that the same code has no problems in VSCode.
IntelliJ 2018.1 EAP
VSCode latest stable version
My understanding is the Typescript language service has built in functionality for autocomplete (among other things). It seems like that built-in functionality works very well based on how responsive VSCode is. IntelliJ must be trying to do something above and beyond the language service. I would really love it if when we select the "Typescript Language Service" option, IntelliJ delegated everything possible to it and tried to add nothing extra on top.
I'm very happy with IntelliJ when it comes to Java and I really dislike having to use separate IDEs for Java in the backend and Typescript in the frontend, but that's where I'm at right now because of the poor IntelliJ Typescript performance so I'm hoping it will be improved.
@kpd, thanks. Logged as https://youtrack.jetbrains.com/issue/WEB-31528, please follow it for updates
I got a copy of @kpd's message in my email, but it doesn't appear here. What happened to it?
@Grid T it's 'pending approval' and only visible to admins; you'll see it later