Open mjbvz opened 1 month ago
Though project root is associated with open file, projects arent just related to single open file. They are independently opened and kept alive even after the said open file is closed. (as we might get another open request - may be with different projectRoot). The projects never use projectRootPath from open files for their updates/status for that reason.
Having said that, the watchFile and watchDirectory implementation of web part of tsserver can easily account for things its not interested in and return noop watcher so i dont think we need to change anything in the tsserver project part as such
Acknowledgement
Comment
From https://github.com/microsoft/vscode/issues/221299
On vscode.dev, enabling project wide intellisense with TS 5.5 can cause exceptions in the developer console. Both of these are related to trying to watch/read files that are outside of the project root. We block these as these reads are invalid on web and in some cases can actually cause major perf issues
I believe there are two separate exceptions:
@typescript/lib-*
:In this case, my workspace is
/vscode-vfs/github/mjbvz/vscode-markdown-footnotes
. We should not try reading anything in a parent directory of this, such as/vscode-vfs/github/mjbvz/node_modules
I've caught the exception as a workaround as otherwise this actually ends up being a fatal error for VS Code
watchdirectory
requests for watching/vscode-vfs/github/mjbvz/node_modules
and/vscode-vfs/github/mjbvz/node_modules/@types
If possible, we should never try accessing any files outside of the project root on web. In the
updateOpen
calls, we pass in aprojectRootPath
to try to prevent this