Skip to content

Commit 4e0f524

Browse files
authored
perf(lsp): don't watch node_modules files (#30768)
1 parent 0c67bb5 commit 4e0f524

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cli/lsp/config.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,9 +1774,10 @@ impl ConfigTree {
17741774

17751775
pub fn is_watched_file(&self, specifier: &Url) -> bool {
17761776
let path = specifier.path();
1777-
if path.ends_with("/deno.json")
1778-
|| path.ends_with("/deno.jsonc")
1779-
|| path.ends_with("/package.json")
1777+
if !path.contains("/node_modules/")
1778+
&& (path.ends_with("/deno.json")
1779+
|| path.ends_with("/deno.jsonc")
1780+
|| path.ends_with("/package.json"))
17801781
|| path.ends_with("/node_modules/.package-lock.json")
17811782
|| path.ends_with("/node_modules/.yarn-integrity.json")
17821783
|| path.ends_with("/node_modules/.modules.yaml")

0 commit comments

Comments
 (0)