Skip to content

Commit

Permalink
Fix #3166
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyo930021 committed Oct 12, 2021
1 parent 40b1258 commit 22577f6
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions server/src/services/vls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,12 @@ export class VLS {
if (!projectConfig) {
return undefined;
}
const useWorkspaceDependencies = projectConfig.vlsFullConfig.vetur.useWorkspaceDependencies;
if (this.projects.has(projectConfig.rootFsPath)) {
return this.projects.get(projectConfig.rootFsPath);
const project = this.projects.get(projectConfig.rootFsPath);
if (project?.env.getConfig().vetur.useWorkspaceDependencies === useWorkspaceDependencies) {
return project;
}
}
// Load project once
if (this.loadingProjects.includes(projectConfig.rootFsPath)) {
Expand All @@ -347,10 +351,11 @@ export class VLS {
this.loadingProjects.push(projectConfig.rootFsPath);
const workDoneProgress = await this.lspConnection.window.createWorkDoneProgress();
workDoneProgress.begin(`Load project: ${projectConfig.rootFsPath}`, undefined);
const nodeModulePaths =
this.nodeModulesMap.get(projectConfig.rootPathForConfig) ??
createNodeModulesPaths(projectConfig.rootPathForConfig);
if (this.nodeModulesMap.has(projectConfig.rootPathForConfig)) {
const nodeModulePaths = useWorkspaceDependencies
? this.nodeModulesMap.get(projectConfig.rootPathForConfig) ??
createNodeModulesPaths(projectConfig.rootPathForConfig)
: [];
if (useWorkspaceDependencies) {
this.nodeModulesMap.set(projectConfig.rootPathForConfig, nodeModulePaths);
}
const dependencyService = await createDependencyService(
Expand Down

0 comments on commit 22577f6

Please sign in to comment.