Skip to content

Commit

Permalink
fix: semantic highlight can't update in js project
Browse files Browse the repository at this point in the history
close #685
  • Loading branch information
johnsoncodehk committed Nov 11, 2021
1 parent 9beca27 commit ee9fa35
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/server/src/projects.ts
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -249,6 +251,7 @@ function createWorkspace(
getProjectAndTsConfig,
getProjectByCreate,
getInferredProject,
getInferredProjectDontCreate: () => inferredProject,
};

async function getProject(uri: string) {
Expand Down

0 comments on commit ee9fa35

Please sign in to comment.