diff --git a/packages/core/src/volar/language-server.ts b/packages/core/src/volar/language-server.ts index 11349a50..4e61f7c6 100644 --- a/packages/core/src/volar/language-server.ts +++ b/packages/core/src/volar/language-server.ts @@ -25,9 +25,10 @@ import { offsetToPosition } from '../language-server/util/position.js'; import { Disposable } from '@volar/language-service'; const connection = createConnection(); - const server = createServer(connection); +const EXTENSIONS = ['js', 'ts', 'gjs', 'gts', 'hbs']; + /** * Handle the `initialize` request from the client. This is the first request sent by the client to * the server. It includes the set of capabilities supported by the client as well as @@ -36,8 +37,8 @@ const server = createServer(connection); connection.onInitialize((parameters) => { // Not sure how tsLocalized is used. const tsLocalized = undefined; - const watchingExtensions = new Set(); - let fileWatcher: Promise | undefined; + const watchingExtensions = new Set(); + let fileWatcher: Promise | undefined; const project = createTypeScriptProject(ts, tsLocalized, (projectContext) => { const configFileName = projectContext.configFileName; @@ -111,9 +112,8 @@ connection.onInitialize((parameters) => { }), ); - function updateFileWatcher() { - const extensions = ['js', 'ts', 'gjs', 'gts', 'hbs']; - const newExtensions = extensions.filter((ext) => !watchingExtensions.has(ext)); + function updateFileWatcher(): void { + const newExtensions = EXTENSIONS.filter((ext) => !watchingExtensions.has(ext)); if (newExtensions.length) { for (const ext of newExtensions) { watchingExtensions.add(ext);