Repository: vscode
Issue: High resource usage and file watcher creation on github.dev
Labels: bug,typescript,freeze-slow-crash-leak,web

```
Version: 1.94.0-insider
Commit: 8b7eb51f54d7e1492d9baf70454ab6547a4ff9df
Date: 2024-09-10T05:04:21.546Z
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0
```

When I opened up https://github.dev/microsoft/TypeScript/pull/59688, I found that my language service wasn't working, and every hover showed up as `Loading...`.

<details>
<summary>

When I turned TypeScript's log level to `Trace`, the output I saw was something like the text in this `<details>` pane.

</summary>

```
2024-09-10 11:04:36.525 [trace] Creating file watcher for review://github%2B7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/tests/baselines/reference/node_modules/%40types/typescript__lib-es2015
2024-09-10 11:04:36.527 [trace] Creating file watcher for review://github%2B7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/tests/baselines/node_modules/%40typescript/lib-es2015
2024-09-10 11:04:36.529 [trace] Creating file watcher for review://github%2B7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/tests/baselines/node_modules/%40types/typescript__lib-es2015
2024-09-10 11:04:36.532 [trace] Creating file watcher for review://github%2B7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/tests/node_modules/%40typescript/lib-es2015
```2024-09-10 11:04:36.547 [trace] Creating file watcher for review://github%2B7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/tests/node_modules/%40types/typescript__lib-es2015
2024-09-10 11:04:36.550 [trace] Creating file watcher for review://github%2B7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/node_modules/%40typescript/lib-es2015
2024-09-10 11:04:36.554 [trace] Creating file watcher for review://github%2B7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/node_modules/%40types/typescript__lib-es2015
2024-09-10 11:04:36.557 [trace] Creating file watcher for review://github%2B7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/node_modules/%40typescript/lib-es2015
2024-09-10 11:04:36.559 [trace] Creating file watcher for review://github%2B7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/node_modules/%40types/typescript__lib-es2015
2024-09-10 11:04:36.847 [trace] Creating file watcher for review://github%2B7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/tests/baselines/reference/tsserver/fourslashServer/node_modules/%40typescript/lib-webworker
2024-09-10 11:04:36.850 [trace] Creating file watcher for review://github%2B7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/tests/baselines/reference/tsserver/fourslashServer/node_modules/%40types/typescript__lib-webworker
2024-09-10 11:04:36.854 [trace] Creating file watcher for review://github%2B7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/tests/baselines/reference/tsserver/node_modules/%40typescript/lib-webworker
2024-09-10 11:04:36.858 [trace] Creating file watcher for review://github%2B7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/tests/baselines/reference/tsserver/node_modules/%40types/typescript__lib-webworker
2024-09-10 11:04:36.861 [trace] Creating file watcher for review://github%2B7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/tests/baselines/reference/node_modules/%40typescript/lib-webworker
2024-09-10 11:04:36.864 [trace] Creating file watcher for review://github%2B7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/tests/baselines/reference/node_modules/%40types/typescript__lib-webworker
2024-09-10 11:04:36.882 [trace] Creating file watcher for review://github%2B7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/tests/baselines/node_modules/%40typescript/lib-webworker
2024-09-10 11:04:36.884 [trace] Creating file watcher for review://github%2B7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/tests/baselines/node_modules/%40types/typescript__lib-webworker
2024-09-10 11:04:36.889 [trace] Creating file watcher for review://github%2B7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/tests/node_modules/%40typescript/lib-webworker
2024-09-10 11:04:36.892 [trace] Creating file watcher for review://github%2B7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/tests/node_modules/%40types/typescript__lib-webworker
2024-09-10 11:04:36.894 [trace] Creating file watcher for review://github%2B7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/node_modules/%40typescript/lib-webworke
```

</details>

With something like the following interspersed:


```
2024-09-10 11:07:31.168 [trace] <diagnostics> Event received: configFileDiag (0). {
    "triggerFile": "/review/github+7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_existingImports1.js",
    "configFile": "/review/github+7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/tests/baselines/reference/tsserver/fourslashServer/tsconfig.json",
    "diagnostics": [
        {
            "text": "Cannot read file '/review/github+7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/tests/baselines/reference/tsserver/fourslashServer/tsconfig.json'.",
            "code": 5083,
            "category": "error"
        },
        {
            "text": "No inputs were found in config file '/review/github+7b2276223a312c22726566223a7b2274797065223a332c226964223a223539363838227d7d/microsoft/TypeScript/tests/baselines/reference/tsserver/fourslashServer/tsconfig.json'. Specified 'include' paths were '[\"**/*\"]' and 'exclude' paths were '[]'.",
            "code": 18003,
            "category": "error"
        }
    ]
}
```

My browser's diagnostic tools signaled the process was maxing out at least a few cores and that the process was pushing close to 1GB in memory usage.