Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm committed Jun 26, 2024
1 parent 1270c3e commit 8046cf0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/language-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
}
]
Expand Down

0 comments on commit 8046cf0

Please sign in to comment.