Skip to content

Commit 581e120

Browse files
kyliauKeen Yee Liau
authored andcommitted
fix: do not disable language service if ngcc fails
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 warn users about potentially degraded experience. Fix #1041
1 parent 996a413 commit 581e120

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

client/src/client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ function registerProgressHandlers(client: lsp.LanguageClient, context: vscode.Ex
129129
progressReporters.delete(configFilePath);
130130
if (!params.success) {
131131
const selection = await vscode.window.showErrorMessage(
132-
`Failed to run ngcc. Ivy language service is disabled. ` +
132+
`Angular extension might not work correctly because ngcc operation failed. ` +
133+
`Try to invoke ngcc manually by running 'npm/yarn run ngcc'. ` +
133134
`Please see the extension output for more information.`,
134-
{modal: true},
135-
'See error message',
135+
'Show output',
136136
);
137137
if (selection) {
138138
client.outputChannel.show();

server/src/session.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,11 @@ export class Session {
152152
});
153153
}
154154

155-
if (!success) {
156-
return;
157-
}
155+
// Re-enable language service even if ngcc fails, because users could fix
156+
// the problem by running ngcc themselves. If we keep language service
157+
// disabled, there's no way users could use the extension even after
158+
// resolving ngcc issues. On the client side, we will warn users about
159+
// potentially degraded experience.
158160

159161
this.reenableLanguageServiceForProject(configFilePath);
160162
}

0 commit comments

Comments
 (0)