From 8d45f8767249bfcd47fccbe3c0cb83324a8b386f Mon Sep 17 00:00:00 2001 From: "L." Date: Thu, 29 Feb 2024 20:25:08 +0800 Subject: [PATCH] feat: enable continuous mode for status button Use VSCode's built-in commands "testing.startContinuousRun" and "testing.stopContinuousRun" to toggle continuous mode for the Vitest status button. --- src/StatusBarItem.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/StatusBarItem.ts b/src/StatusBarItem.ts index 41793038..f19aa024 100644 --- a/src/StatusBarItem.ts +++ b/src/StatusBarItem.ts @@ -16,6 +16,7 @@ export class StatusBarItem extends vscode.Disposable { } toDefaultMode() { + this.item.command = 'testing.startContinuousRun' this.item.text = '$(test-view-icon) Vitest' this.item.tooltip = 'Click to start watch mode' this.setBackgroundColor(false) @@ -33,6 +34,7 @@ export class StatusBarItem extends vscode.Disposable { skipped: number }, ) { + this.item.command = 'testing.stopContinuousRun' const total = passed + failed const percentOfExecutedTests = Number((passed / total * 100).toFixed(0)) const percentIsValid = !Number.isNaN(percentOfExecutedTests) @@ -48,6 +50,7 @@ export class StatusBarItem extends vscode.Disposable { } toRunningMode() { + this.item.command = 'testing.stopContinuousRun' this.item.text = '$(loading~spin) Vitest is running' this.item.tooltip = 'Click to stop watching' this.setBackgroundColor(false)