Skip to content

Commit

Permalink
fix(language-server): don't watch files in hybrid mode
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Apr 30, 2024
1 parent 31c9148 commit 34700c5
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions packages/language-server/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ export const getLanguagePlugins: GetLanguagePlugin = async (serviceEnv, configFi
commandLine?.options ?? {},
vueOptions,
);
const extensions = [
...vueOptions.extensions.map(ext => ext.slice(1)),
...vueOptions.vitePressExtensions.map(ext => ext.slice(1)),
...vueOptions.petiteVueExtensions.map(ext => ext.slice(1)),
];
if (!hybridMode) {
extensions.push('js', 'cjs', 'mjs', 'ts', 'cts', 'mts', 'jsx', 'tsx', 'json');
}
const newExtensions = extensions.filter(ext => !watchedExtensions.has(ext));
if (newExtensions.length) {
for (const ext of newExtensions) {
watchedExtensions.add(ext);
const extensions = [
'js', 'cjs', 'mjs', 'ts', 'cts', 'mts', 'jsx', 'tsx', 'json',
...vueOptions.extensions.map(ext => ext.slice(1)),
...vueOptions.vitePressExtensions.map(ext => ext.slice(1)),
...vueOptions.petiteVueExtensions.map(ext => ext.slice(1)),
];
const newExtensions = extensions.filter(ext => !watchedExtensions.has(ext));
if (newExtensions.length) {
for (const ext of newExtensions) {
watchedExtensions.add(ext);
}
server.watchFiles(['**/*.{' + newExtensions.join(',') + '}']);
}
server.watchFiles(['**/*.{' + newExtensions.join(',') + '}']);
}

envToVueOptions.set(serviceEnv, vueOptions);
Expand Down

0 comments on commit 34700c5

Please sign in to comment.