Skip to content

Commit 1f0fafd

Browse files
committed
fix(vscode): compatible with VSCode 1.93.1
close #36
1 parent 50768bd commit 1f0fafd

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Diff for: packages/vscode/extension.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@ try {
1717
text = text.replace('t.has(e.code+"")', s => `(${s}||e.source==="tsslint")`);
1818

1919
// support "Fix all"
20-
text = text.replace(`const i=new y(t,n,r);`, s => s + `
20+
for (const replaceText of [
21+
'const i=new y(t,n,r);',
22+
// VSCode 1.93.1 (#36)
23+
'const i=new v(t,n,r)',
24+
]) {
25+
if (!text.includes(replaceText)) {
26+
continue;
27+
}
28+
text = text.replace(replaceText, s => s + `
2129
const vscode = require('vscode');
2230
vscode.languages.registerCodeActionsProvider(
2331
e.semantic,
@@ -88,7 +96,8 @@ vscode.languages.registerCodeActionsProvider(
8896
{
8997
providedCodeActionKinds: [vscode.CodeActionKind.SourceFixAll.append('tsslint')],
9098
}
91-
);`)
99+
);`)
100+
}
92101

93102
// sort plugins
94103
text = text.replace('"--globalPlugins",i.plugins', '"--globalPlugins",i.plugins.sort((a,b)=>(b.name==="@tsslint/typescript-plugin"?1:0)-(a.name==="@tsslint/typescript-plugin"?1:0))');

0 commit comments

Comments
 (0)