microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
100.16k stars 12.38k forks source link

TypeScript file watcher holds onto folders and causes EPERM #54087

Open yinxing-ws opened 1 year ago

yinxing-ws commented 1 year ago

Does this issue occur when all extensions are disabled?: Yes/No

Steps to Reproduce:

  1. just rename or moving files/folder, and this problem occasionally.
  2. After restart vscode, the rename/moving operation completed automatically.
  3. I'm pretty sure the rename/moving operation act normally in file explorer

I have checked all below items, so I'm pretty sure there is no other process using these files except vs code.

  1. no other window opened.
  2. no vscode extension runing because I uninstall them all.
  3. only vscode using the file, It's weird because there are two records. image
bpasero commented 5 months ago

Then I suggest to file an issue to the tool you are running that results in the file lock.

hbatalhaStch commented 5 months ago

Then I suggest to file an issue to the tool you are running that results in the file lock.

Yes I agree, thank you for looking into it though.

mmorton commented 5 months ago

So, typescript.tsserver.experimental.useVsCodeWatcher does seem to solve the issue for me. Though, fixing it did cause me to notice that tsc, when run as a (vscode) task for project wide errors, holds odd folder locks from time to time too. Would be awesome if we could get the project wide analysis for tsserver, not just for open files.

hbatalhaStch commented 5 months ago

Would be awesome if we could get the project wide analysis for tsserver, not just for open files.

There's already an option for that: typescript.tsserver.experimental.enableProjectDiagnostics