File tree 1 file changed +9
-15
lines changed
1 file changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -9,21 +9,15 @@ export class CodeActionsFeature implements IFeature {
9
9
10
10
constructor ( ) {
11
11
this . command = vscode . commands . registerCommand ( 'PowerShell.ApplyCodeActionEdits' , ( edit : any ) => {
12
- var editor = Window . activeTextEditor ;
13
- var filePath = editor . document . fileName ;
14
- var workspaceEdit = new vscode . WorkspaceEdit ( ) ;
15
- workspaceEdit . set (
16
- vscode . Uri . file ( filePath ) ,
17
- [
18
- new vscode . TextEdit (
19
- new vscode . Range (
20
- edit . StartLineNumber - 1 ,
21
- edit . StartColumnNumber - 1 ,
22
- edit . EndLineNumber - 1 ,
23
- edit . EndColumnNumber - 1 ) ,
24
- edit . Text )
25
- ] ) ;
26
- vscode . workspace . applyEdit ( workspaceEdit ) ;
12
+ Window . activeTextEditor . edit ( ( editBuilder ) => {
13
+ editBuilder . replace (
14
+ new vscode . Range (
15
+ edit . StartLineNumber - 1 ,
16
+ edit . StartColumnNumber - 1 ,
17
+ edit . EndLineNumber - 1 ,
18
+ edit . EndColumnNumber - 1 ) ,
19
+ edit . Text ) ;
20
+ } ) ;
27
21
} ) ;
28
22
}
29
23
You can’t perform that action at this time.
0 commit comments