Open jfirebaugh opened 1 year ago
This applies for for symlinked files as well: you can replace step 2 with rm scratch2/index.ts
, and observe the same actual behavior after recreating that file in step 3.
After step 3, command clicking on the text with the squiggle opens a tab that displays the following:
However, you can open src/symlink/index.ts
successfully from the Explorer.
Our file watcher does not support changes to targets that are in the workspace behind symbolic links. In other words, the file watcher will not automatically follow symlinks for performance reasons. You can tell this by looking at the file explorer that does not remove the symbolic link from the tree even though it is deleted.
We have limited support to add additional folders to be watched via the files.watcherInclude
setting, but in this scenario when I test, I am not seeing file events for when the folder is being recreated.
However here I believe TypeScript is doing something on their own, because they do detect the delete but not the recreation, so maybe this is something TypeScript deals specifically.
Yes, I concur that it's a TypeScript issue -- I was able to reproduce the same issue in another editor (IntelliJ IDEA). Do you have the ability to transfer the issue to the microsoft/typescript repository?
We have roughly similar trade-offs around watch. You can toggle between different watch strategies and find the one that works best for your scenarios.
As far as I can tell, none of those options would allow this scenario to function as expected.
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
Open
test.ts
. It should have no errors.rm -rf scratch2
. After vscode detects the change, it should display a red squiggle under./symlink/index
with the error "Cannot find module ...".mkdir scratch2 && echo "export const Foo = 1;" >scratch2/index.ts
The expected behavior at this point is that vscode recognizes that the target directory of the symlink once again exists, and removes the red squiggle.
The actual behavior is that the squiggle does not go away. You must close and reopen the project to get vscode to recognize that the code is valid.