diff --git a/package.json b/package.json index 1b67e96d..6ec7a6c6 100644 --- a/package.json +++ b/package.json @@ -45,21 +45,6 @@ "title": "Update Snapshot", "command": "vitest.updateSnapshot", "category": "Vitest" - }, - { - "title": "Start Watch Mode", - "command": "vitest.startWatching", - "category": "Vitest" - }, - { - "title": "Stop Watch Mode", - "command": "vitest.stopWatching", - "category": "Vitest" - }, - { - "title": "Toggle Watch Mode", - "command": "vitest.toggleWatching", - "category": "Vitest" } ], "menus": { @@ -67,14 +52,6 @@ { "command": "vitest.updateSnapshot", "when": "false" - }, - { - "command": "vitest.startWatching", - "when": "false" - }, - { - "command": "vitest.stopWatching", - "when": "false" } ], "testing/item/context": [ diff --git a/src/StatusBarItem.ts b/src/StatusBarItem.ts index 61ae5943..8ae47b88 100644 --- a/src/StatusBarItem.ts +++ b/src/StatusBarItem.ts @@ -17,7 +17,6 @@ export class StatusBarItem extends vscode.Disposable { } toDefaultMode() { - this.item.command = Command.StartWatching this.item.text = '$(test-view-icon) Vitest' this.item.tooltip = 'Click to start watch mode' this.setBackgroundColor(false) @@ -35,7 +34,6 @@ export class StatusBarItem extends vscode.Disposable { skipped: number }, ) { - this.item.command = Command.StopWatching const total = passed + failed const percentOfExecutedTests = Number((passed / total * 100).toFixed(0)) const percentIsValid = !Number.isNaN(percentOfExecutedTests) @@ -51,7 +49,6 @@ export class StatusBarItem extends vscode.Disposable { } toRunningMode() { - this.item.command = Command.StopWatching this.item.text = '$(loading~spin) Vitest is running' this.item.tooltip = 'Click to stop watching' this.setBackgroundColor(false) diff --git a/src/command.ts b/src/command.ts index d71437e0..0ec0d1b1 100644 --- a/src/command.ts +++ b/src/command.ts @@ -1,6 +1,3 @@ export enum Command { - StartWatching = 'vitest.startWatching', - StopWatching = 'vitest.stopWatching', UpdateSnapshot = 'vitest.updateSnapshot', - ToggleWatching = 'vitest.toggleWatching', } diff --git a/src/extension.ts b/src/extension.ts index 19a394c1..0f3637da 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -190,15 +190,6 @@ function registerWatchHandlers( }, ...testWatchers, statusBarItem, - vscode.commands.registerCommand(Command.StartWatching, startWatching), - vscode.commands.registerCommand(Command.StopWatching, stopWatching), - vscode.commands.registerCommand(Command.ToggleWatching, () => { - const anyWatching = testWatchers.some(watcher => watcher.isWatching.value) - if (anyWatching) - stopWatching() - else - startWatching() - }), ) ctrl.createRunProfile(