VSCode TypeScript 智能感知需要很长时间才能远程加载

Pro*_*eak 5 javascript intellisense typescript file-watcher visual-studio-code

每次我通过 VSCode 连接到远程Linux 服务器时,都会弹出一个通知 - 初始化 JS/TS 语言功能。与之相关的扩展可能是“TypeScript 和 JavaScript 语言功能”。我想我可能需要这个扩展才能使智能感知正常工作(除非你们中的任何人都可以提出任何其他替代方案)。

这需要永远。(如果我本地运行VSCode,几乎是即时的)

我认为问题在于 FileWatcher 和 DirectoryWatcher 需要永远加载大文件/文件夹(例如 node_modules)。

我想正确排除node_modules。这是我尝试在 ./.vscode/settings.json 中实现的:

{
    "files.watcherExclude": {
        "/**/node_modules/*/**": true,
        "/**/node_modules": true,
        "/home/abc/a/**": true,
        "/home/abc/b/node_modules": true,
        "/home/abc/b/node_modules/*/**": true
    }
}
Run Code Online (Sandbox Code Playgroud)

但根据 tsserver.log:

Info 111  [10:34:23.652] DirectoryWatcher:: Added:: WatchInfo: /home/abc/b/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache
Run Code Online (Sandbox Code Playgroud)

VSCode 仍在监视 node_modules,并且需要几十年的时间才能出现下一行......

10分钟后:

Info 112  [11:16:39.533] Elapsed:: 675488.8780369759ms DirectoryWatcher:: Added:: WatchInfo: /home/abc/b/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache
Run Code Online (Sandbox Code Playgroud)

正确禁用 node_modules 的 FileWatcher 和 DirectoryWatcher 的方法是什么?