Skip to content

Commit d0146ae

Browse files
committed
fix: Resolve circular reference in vscode mock for CodeActionKind
1 parent 8728053 commit d0146ae

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

src/__mocks__/vscode.js

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,6 @@ const vscode = {
8181
this.isPreferred = false
8282
}
8383
},
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-
},
9684
FileType: {
9785
Unknown: 0,
9886
File: 1,
@@ -106,4 +94,21 @@ const vscode = {
10694
},
10795
}
10896

97+
// Define CodeActionKind after vscode object is created
98+
class CodeActionKind {
99+
constructor(value) {
100+
this.value = value
101+
}
102+
103+
append(value) {
104+
return new CodeActionKind(`${this.value}.${value}`)
105+
}
106+
}
107+
108+
// Add static properties after class definition
109+
CodeActionKind.QuickFix = new CodeActionKind("quickfix")
110+
CodeActionKind.RefactorRewrite = new CodeActionKind("refactor.rewrite")
111+
112+
vscode.CodeActionKind = CodeActionKind
113+
109114
module.exports = vscode

0 commit comments

Comments
 (0)