VSCode TypeScript intellisense takes forever to load remotely
Asked Answered
F

0

7

Every time I connect to Remote Linux Server via VSCode, there's a notification popping up - Initializing JS/TS language features. The relevant extension to this is probably "TypeScript and JavaScript Language Features". I think I would probably need this extension for intellisense to work properly (unless if any of y'all can suggest any other alternatives).

It takes forever. (It's almost instant if I run VSCode locally)

I think the issue lies on having FileWatcher and DirectoryWatcher taking forever to load for big files/folders such as node_modules.

I would like to exclude node_modules properly. This is what I have tried to implement in ./.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
    }
}

But according to 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

VSCode is still watching node_modules and it takes decades for the next lines to appear...

After 10 minutes:

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

What's the approach to properly disabling FileWatcher and DirectoryWatcher for node_modules?

Franctireur answered 25/1, 2022 at 19:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.