Skip to content

Commit

Permalink
fix(language-server): additionalExtensions option not working for i…
Browse files Browse the repository at this point in the history
…nferred project
  • Loading branch information
johnsoncodehk committed Mar 23, 2024
1 parent 510a557 commit 5e6da11
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/language-server/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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}`);
}
}
Expand Down

0 comments on commit 5e6da11

Please sign in to comment.