Skip to content
Open
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;
1 change: 1 addition & 0 deletions editors/vscode/tests/code_actions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ suite('code actions', () => {
// flaky test for multi workspace mode
testSingleFolderMode('listed code actions', async () => {
await loadFixture('debugger');
await sleep(500);
const fileUri = Uri.joinPath(fixturesWorkspaceUri(), 'fixtures', 'debugger.js');
// await window.showTextDocument(fileUri); -- should also work without opening the file

Expand Down
19 changes: 19 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,23 @@ 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);
await workspace.saveAll();
await waitForDiagnosticChange();

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

// enable it for other tests
await workspace.getConfiguration('oxc').update('enable', true);
await workspace.saveAll();
await sleep(500);
})
});
Loading