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

VSCode and intellisense are broken and unstable #32033

Closed
CyriacBr opened this issue Jun 20, 2019 · 11 comments
Closed

VSCode and intellisense are broken and unstable #32033

CyriacBr opened this issue Jun 20, 2019 · 11 comments
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue

Comments

@CyriacBr
Copy link

CyriacBr commented Jun 20, 2019

  • VSCode Version: 1.35.5
  • OS Version: Linux Elementary OS

Steps to Reproduce:

  1. Open a TS project with VSCode.
  2. Either:
    *Remove the node_modules folder
    *Reinstall/delete/add a new npm package
    *Use npm/yarn link
  3. Intellisense breaks. When removing packages, you will get a bunch of errors, which is normal. But installing back everything doesn't update TS state.
    Somehow VSCode bugs and gets stuck at a previous state. In the case of npm link sometimes it doesn't recognize the package being added.
    When that happens, in most cases, TS server shuts down and any Intellisense feature is infinitely "Loading..." when required.
    Though, sometimes things work out when I trigger autocomplete and everything is back to normal.

I have to restart VSCode or the TS Server all the time to refresh intellisense.
It just seems that VSCode cannot reliably react to any kind of file changes.

It's been like that since forever as far as I recall, however, the last few updates just made things worse I guess. I've never had a 100% reliable TS experience.
With the latest update, syntax highlighting stops working randomly too.

Does this issue occur when all extensions are disabled?: Yes it does.

@CyriacBr
Copy link
Author

This seems to be related to this issue: microsoft/vscode#71751

@mjbvz mjbvz transferred this issue from microsoft/vscode Jun 21, 2019
@mjbvz
Copy link
Contributor

mjbvz commented Jun 21, 2019

@sheetalkamat I suspect this is related to the file watcher. Simple repo:

  1. Create a new angular project ng new app
  2. Open in VS Code and open a ts file
  3. Now delete node_modules
  4. Intellisense hangs for ~a minute
  5. Now npm install
  6. Another hang

In the larger VS Code repo, doing these steps can cause the server to get into a state where it never seems to finish loading

@RyanCavanaugh RyanCavanaugh assigned sheetalkamat and unassigned mjbvz Jun 26, 2019
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.6.0 milestone Jun 26, 2019
@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Jun 26, 2019
@venky76v
Copy link

venky76v commented Jul 2, 2019

Hi, I too seem to have this issue. Open a newly created Angular repo in VS code, don't know if this is related to any extennsion. Intellisense doesn't seem to work at all. All I get is "Loading...". Sometimes is works randomly, other times it doesn't all. This is a productivity killer and it is very annoying.

image

@CyriacBr
Copy link
Author

CyriacBr commented Jul 3, 2019

@sheetalkamat If that can help, I found that refreshing the tsconfig.json (ie, deleting a character, undoing and saving the file) makes TS works again like usual.
But it's still annoying to do so every time you yarn add something and TS breaks.

@venky76v When that happens, do you see the "Initializing TS/JS languages features" at the bottom-left in the status bar? If so then that's normal that Intellisense doesn't work right after opening an Angular repo because VSCode needs to initialize the TS features first.

@OneCyrus
Copy link

OneCyrus commented Jul 3, 2019

we have this issue as well. changing some types lead to a „stuck“ typescript experience. changing between integrated and workspace version (basically restarting typescript) fixes the issue until it breaks again.

@venky76v
Copy link

venky76v commented Jul 4, 2019

@sheetalkamat If that can help, I found that refreshing the tsconfig.json (ie, deleting a character, undoing and saving the file) makes TS works again like usual.
But it's still annoying to do so every time you yarn add something and TS breaks.

@venky76v When that happens, do you see the "Initializing TS/JS languages features" at the bottom-left in the status bar? If so then that's normal that Intellisense doesn't work right after opening an Angular repo because VSCode needs to initialize the TS features first.

Hi, As soon as I open a Angular repo, I see the initializing JS/TS features on the status bar. After this the message is gone. Now opening a ts file, say app.component.ts file and type this. + control + spacebar, all I see "Loading..." like so below:
image

If I leave the VS window and come back to it after a few minutes, like write this reply and then come back and hit control + space bar, I see the intellisense working. This is a productivity killer and it also kills your flow of throught, as well the behavior being totally inconsistent.

image

@CyriacBr
Copy link
Author

CyriacBr commented Jul 5, 2019

Hi, As soon as I open a Angular repo, I see the initializing JS/TS features on the status bar. After this the message is gone. Now opening a ts file, say app.component.ts file and type this. + control + spacebar, all I see "Loading..." like so below:

I see. This is not really the issue I am describing. I suggest you look into others issue. I recall seeing something similar elsewhere. Do you still have that problem with all extensions disabled?
The problem that @OneCyrus and I are facing is that Typescript breaks when a file changes.

Just right now I cloned a git monorepo. Naturally, the packages were not installed, so Typescript was signaling 'modules not found' left and right. Even after I ran yarn and lerna to bootstrap and link all the packages in the repo Typescript was still stuck at its previous state. I once again had to reload the TS server.

@Morphexe
Copy link

Not 100% sure if related - but seems to fit -, but I have been finding that ts server and tsc sometimes will just stop listening for file changes, as in, if you make a change to a file, it doesn't get picked up to trigger a incremental compilation.

@sheetalkamat sheetalkamat added Bug A bug in TypeScript and removed Needs Investigation This issue needs a team member to investigate its status. labels Jul 31, 2019
@sheetalkamat
Copy link
Member

This seems to be Linux and potentially macOs specific issue and result of https://nodejs.org/dist/latest-v10.x/docs/api/fs.html#fs_inodes inode watching. Looking into fix for this issue. Thanks

@svipas
Copy link

svipas commented Sep 29, 2019

I can confirm I have this issue and I can agree it's related to file watching. I'm using macOS 10.14.6.

@sheetalkamat
Copy link
Member

#35615 (comment) is the fix for this. Feel free to try it out and provide feedback. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Projects
None yet
Development

No branches or pull requests

9 participants