Skip to content
Draft
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions editors/vscode/client/tools/linter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ export default class LinterTool implements ToolInterface {
statusBarItemHandler: StatusBarItemHandler,
): Promise<void> {
this.updateStatusBar(statusBarItemHandler, configService.vsCodeConfig.enable);
if (event.affectsConfiguration(`${ConfigService.namespace}.enable`)) {
await this.toggleClient(configService); // update the client state
}

if (this.client === undefined) {
return;
Expand Down
1 change: 1 addition & 0 deletions editors/vscode/fixtures/changing_enable/debugger.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
debugger;
21 changes: 21 additions & 0 deletions editors/vscode/tests/e2e_server_linter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,4 +282,25 @@ suite('E2E Server Linter', () => {
const secondDiagnostics = await getDiagnostics('index.ts');
strictEqual(secondDiagnostics.length, 1);
});

testSingleFolderMode('changing oxc.enable will update the client status', async () => {
await loadFixture('changing_enable');

const firstDiagnostics = await getDiagnostics('debugger.js');
strictEqual(firstDiagnostics.length, 1);

await workspace.getConfiguration('oxc').update('enable', false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to reset this configuration. Try the teardown function at the top, or at the end of this test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated! Tysm!

await workspace.saveAll();
await waitForDiagnosticChange();

const secondDiagnostics = await getDiagnostics('debugger.js');
strictEqual(secondDiagnostics.length, 0);

await workspace.getConfiguration('oxc').update('enable', true);
await workspace.saveAll();
await waitForDiagnosticChange();

const thirdDiagnostics = await getDiagnostics('debugger.js');
strictEqual(thirdDiagnostics.length, 1);
})
});
Loading