Skip to content

Commit

Permalink
fix!: remove watch commands since continuous is now a possibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ffMathy committed Feb 22, 2024
1 parent 6e7d264 commit baeaa33
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 38 deletions.
23 changes: 0 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,36 +45,13 @@
"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": {
"commandPalette": [
{
"command": "vitest.updateSnapshot",
"when": "false"
},
{
"command": "vitest.startWatching",
"when": "false"
},
{
"command": "vitest.stopWatching",
"when": "false"
}
],
"testing/item/context": [
Expand Down
3 changes: 0 additions & 3 deletions src/StatusBarItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions src/command.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
export enum Command {
StartWatching = 'vitest.startWatching',
StopWatching = 'vitest.stopWatching',
UpdateSnapshot = 'vitest.updateSnapshot',
ToggleWatching = 'vitest.toggleWatching',
}
9 changes: 0 additions & 9 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit baeaa33

Please sign in to comment.