Skip to content

Commit 8728053

Browse files
committed
fix: Add proper CodeAction and CodeActionKind mocks to global vscode mock
1 parent 264aad8 commit 8728053

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/__mocks__/vscode.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,26 @@ const vscode = {
7373
Development: 2,
7474
Test: 3,
7575
},
76+
CodeAction: class {
77+
constructor(title, kind) {
78+
this.title = title
79+
this.kind = kind
80+
this.command = undefined
81+
this.isPreferred = false
82+
}
83+
},
84+
CodeActionKind: class {
85+
constructor(value) {
86+
this.value = value
87+
}
88+
89+
append(value) {
90+
return new vscode.CodeActionKind(`${this.value}.${value}`)
91+
}
92+
93+
static QuickFix = new vscode.CodeActionKind("quickfix")
94+
static RefactorRewrite = new vscode.CodeActionKind("refactor.rewrite")
95+
},
7696
FileType: {
7797
Unknown: 0,
7898
File: 1,

0 commit comments

Comments
 (0)