From 8046cf04c488eb5081068d526dea5aaf2a3aa35b Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Wed, 26 Jun 2024 11:36:30 +0200 Subject: [PATCH] comments --- packages/language-server/src/server.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/language-server/src/server.ts b/packages/language-server/src/server.ts index 632681f43..86a1c5836 100644 --- a/packages/language-server/src/server.ts +++ b/packages/language-server/src/server.ts @@ -104,6 +104,8 @@ export function startServer(options?: LSOptions) { pendingWatchPatterns = patterns; }; + // Include Svelte files to better deal with scenarios such as switching git branches + // where files that are not opened in the client could change const nonRecursiveWatchPattern = '*.{ts,js,mts,mjs,cjs,cts,json,svelte}'; const recursiveWatchPattern = '**/' + nonRecursiveWatchPattern; @@ -329,6 +331,8 @@ export function startServer(options?: LSOptions) { connection?.client.register(DidChangeWatchedFilesNotification.type, { watchers: [ { + // Editors have exlude configs, such as VSCode with `files.watcherExclude`, + // which means it's safe to watch recursively here globPattern: recursiveWatchPattern } ]