Skip to content

fix(server): Ensure all projects that finish ngcc re-enable language … #1627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions server/src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1232,15 +1232,19 @@ export class Session {
// prioritized for that project's set of files. This will cause issues if the second project is,
// for example, one that only includes `*.spec.ts` files and not the entire set of files needed
// to compile the app (i.e. `*.module.ts`).
const enabledProjects = new Set<ts.server.Project>();
for (let i = 0; i < this.projectNgccQueue.length && this.projectNgccQueue[i].done; i++) {
// Re-enable language service even if ngcc fails, because users could fix
// the problem by running ngcc themselves. If we keep language service
// disabled, there's no way users could use the extension even after
// resolving ngcc issues. On the client side, we will warn users about
// potentially degraded experience.
this.enableLanguageServiceForProject(this.projectNgccQueue[i].project);
const p = this.projectNgccQueue[i].project;
this.enableLanguageServiceForProject(p);
enabledProjects.add(p);
}
this.projectNgccQueue = this.projectNgccQueue.filter(({done}) => !done);
this.projectNgccQueue =
this.projectNgccQueue.filter(({project}) => !enabledProjects.has(project));
}
}

Expand Down