From ee9fa359565a6e886b65664e471c86865713bfca Mon Sep 17 00:00:00 2001 From: johnsoncodehk Date: Thu, 11 Nov 2021 14:30:48 +0800 Subject: [PATCH] fix: semantic highlight can't update in js project close #685 --- packages/server/src/projects.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/server/src/projects.ts b/packages/server/src/projects.ts index f09382a8e..398a96004 100644 --- a/packages/server/src/projects.ts +++ b/packages/server/src/projects.ts @@ -42,7 +42,8 @@ export function createProjects( documents.onDidChangeContent(async change => { for (const workspace of workspaces.values()) { - for (const project of workspace.projects.values()) { + const projects = [...workspace.projects.values(), workspace.getInferredProjectDontCreate()].filter(shared.notEmpty); + for (const project of projects) { (await project).onDocumentUpdated(change.document); } } @@ -83,7 +84,8 @@ export function createProjects( } if (scriptChanges.length) { - for (const project of workspace.projects.values()) { + const projects = [...workspace.projects.values(), workspace.getInferredProjectDontCreate()].filter(shared.notEmpty); + for (const project of projects) { await (await project).onWorkspaceFilesChanged(scriptChanges); } } @@ -249,6 +251,7 @@ function createWorkspace( getProjectAndTsConfig, getProjectByCreate, getInferredProject, + getInferredProjectDontCreate: () => inferredProject, }; async function getProject(uri: string) {