Repository navigation
Initializing JS/TS language features ignores files.watcherExclude #29782
Description
Activity
files.watcherExcludeonly controls core VS Code's file watching; each language extension implements their own file watching/exclude logic. For js/ts, try using creating ajsconfig.jsonproject definition for your projec tand configureexcludeAlso please try updating to the latest VS Code insiders build
This tsconfig.json doesn't seem to help
{
"compilerOptions": {
"jsx": "react",
"lib":["es2017", "dom"],
"downlevelIteration": true,
"noImplicitThis": true,
"noImplicitReturns":true,
"target":"ES2017",
"moduleResolution":"node",
"noImplicitAny":true
},
"exclude": [
"/node_modules/",
"/.git/"
]
}Everything watched as soon as Initializing JS/TS language finishes. This seems to indicate that there is a problem with the language language extension(?) or that this is the wrong way to configure it.
Tried the insiders version and got the same behavior. Here is a copy of that version's help>about:
Version: 1.31.0-insider
Commit: b313db6c58f8c02181a33cd3b5b4b17c64a5b85d
Date: 2019-02-05T10:12:40.290Z
Electron: 3.1.2
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Linux x64 3.10.0-862.3.2.el7.x86_64Is the file watching actually causing any problems though?
Occasionally in combination with the use of an npm dev server the machine runs out of watcher quota. Sometimes vs code complains it can't watch all the files in the large workspace. It's a shared machine, and while I haven't had any complaints yet, this can cause other things that use watches to fail such as
tail -f.Moving over to TypeScript since it is the tsserver that is watching these files
tsserver doesn't let you configure the watches you want to exclude. This is for best experience in vscode. I am not sure what action we can take here.
cc Ryan Cavanaugh (@RyanCavanaugh) Daniel Rosenwasser (@DanielRosenwasser) Andrew Casey (@amcasey)Is there anything we can do to stop it from watching the /.git files? That directory doesn't have any files I would want typescript looking at.
- addedNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
on Feb 14, 2019 RyanCavanaugh commented
on Feb 14, 2019 MemberMore actionsSheetal Nandi (@sheetalkamat) I don't think we should ever be watching
.git- can you verify that this folder is always excluded from our watches?sheetalkamat commented
on Feb 14, 2019 MemberMore actionsCurrently we ignore anything thats dotted directory/file in node_modules. We can add
.gitto that list- addedDuplicateAn existing issue was already createdAn existing issue was already createdNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.and removedNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.DuplicateAn existing issue was already createdAn existing issue was already created
on Feb 27, 2019 - addedBugA bug in TypeScriptA bug in TypeScriptand removedNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
on Mar 6, 2019 - added a commit that references this issue
on Mar 6, 2019 - addedFixedA PR has been merged for this issueA PR has been merged for this issue
on Mar 6, 2019 - locked as resolved and limited conversation to collaborators
on Oct 21, 2025
details
Initially vs code respects files.watcherExclude upon opening a workspace if no js/ts files are open vs code correctly watches all files in the workspace except for those indicated by files.watcherExclude
However as soon as a JS/TS file is opened the message "initializing JS/TS language features" is shown on the status bar and vscode watches all files.
reproducing
file > preferences > settings > files.watcherExclude
exepected result: vs code should not watch files in the files.watcherExclude setting
actual result: vs code watches all files as soon as JS/TS language features are enabled
how to see what files vs code is watching
There are a number of ways to do this on linux (none of them all that easy).
Exact method may vary depending on version of linux
There are a number of methods discussed in https://unix.stackexchange.com/questions/15509/whos-consuming-my-inotify-resources/426001#426001
The method I used was to find the PID of code using ps EG: ps aux|grep code
this turns up multiple processes as code spawns subprocesses
then take those pids and
grep /proc//fdinfo/* inotify
the text on these lines seems to vary depending on linux version so it may read something else other then inotify
at least on CentOS Linux 7 (Core) these lines contain ino:
from there the number of files being watched can be compared to the number of files expected to be watched or
some method of stating the files in the workspace can be used to see exactly which files are being watched
for example ls -i will tell the inode number of the files listed (in decimal)
VS Code version: Code 1.30.2 (61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8, 2019-01-07T22:49:48.319Z)
OS version: Linux x64 3.10.0-862.3.2.el7.x86_64
System Info
checker_imaging: disabled_off
flash_3d: unavailable_software
flash_stage3d: unavailable_software
flash_stage3d_baseline: unavailable_software
gpu_compositing: unavailable_software
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: unavailable_software
video_decode: unavailable_software
video_encode: unavailable_software
webgl: enabled_readback
webgl2: unavailable_off