Skip to content

Commit 3c27d0d

Browse files
committed
perf(editor): avoid sending workspace/didChangeConfiguration request when the server needs a restarts (#10550)
When the server restarts, we do not need to send the request beforehand.
1 parent d22c1ae commit 3c27d0d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

editors/vscode/client/extension.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,17 +253,15 @@ export async function activate(context: ExtensionContext) {
253253
// update the initializationOptions for a possible restart
254254
client.clientOptions.initializationOptions = { settings };
255255

256-
if (client.isRunning()) {
257-
client.sendNotification('workspace/didChangeConfiguration', { settings });
258-
}
259-
260256
if (event.affectsConfiguration('oxc.configPath')) {
261257
client.clientOptions.synchronize = client.clientOptions.synchronize ?? {};
262258
client.clientOptions.synchronize.fileEvents = createFileEventWatchers(configService.config.configPath);
263259

264260
if (client.isRunning()) {
265261
await client.restart();
266262
}
263+
} else if (client.isRunning()) {
264+
client.sendNotification('workspace/didChangeConfiguration', { settings });
267265
}
268266
};
269267

0 commit comments

Comments
 (0)