Skip to content

Commit ba99ed8

Browse files
committed
fix: only restart language server on angular configuration change
Currently, we stop and start the client on _any_ configuration change. With this commit, we will only do that when the changed configuration affects the `angular` section.
1 parent 8b6e7af commit ba99ed8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

client/src/extension.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ export function activate(context: vscode.ExtensionContext) {
1919
registerCommands(client, context);
2020

2121
// Restart the server on configuration change.
22-
const disposable = vscode.workspace.onDidChangeConfiguration(async () => {
23-
await client.stop();
24-
await client.start();
25-
});
22+
const disposable =
23+
vscode.workspace.onDidChangeConfiguration(async (e: vscode.ConfigurationChangeEvent) => {
24+
if (!e.affectsConfiguration('angular')) {
25+
return;
26+
}
27+
await client.stop();
28+
await client.start();
29+
});
2630
context.subscriptions.push(client, disposable);
2731

2832
client.start();

0 commit comments

Comments
 (0)