From 5e6da114180d5599625053516197c74d4a662941 Mon Sep 17 00:00:00 2001 From: Johnson Chu Date: Sun, 24 Mar 2024 07:46:40 +0800 Subject: [PATCH] fix(language-server): `additionalExtensions` option not working for inferred project --- packages/language-server/node.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/language-server/node.ts b/packages/language-server/node.ts index 0b5dc67e89..a1da022180 100644 --- a/packages/language-server/node.ts +++ b/packages/language-server/node.ts @@ -23,11 +23,10 @@ connection.onInitialize(async params => { const options: VueInitializationOptions = params.initializationOptions; const hybridMode = options.vue?.hybridMode ?? true; + const vueFileExtensions: string[] = ['vue']; tsdk = loadTsdkByPath(options.typescript.tsdk, params.locale); - const vueFileExtensions: string[] = ['vue']; - if (options.vue?.additionalExtensions) { for (const additionalExtension of options.vue.additionalExtensions) { vueFileExtensions.push(additionalExtension); @@ -60,7 +59,7 @@ connection.onInitialize(async params => { const commandLine = await parseCommandLine(); const vueOptions = commandLine?.vueOptions ?? resolveVueCompilerOptions({}); for (const ext of vueFileExtensions) { - if (vueOptions.extensions.includes(`.${ext}`)) { + if (!vueOptions.extensions.includes(`.${ext}`)) { vueOptions.extensions.push(`.${ext}`); } }