File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 1+ import vscode = require( 'vscode' ) ;
2+ import { LanguageClient , RequestType , NotificationType } from 'vscode-languageclient' ;
3+ import Window = vscode . window ;
4+
5+ export function registerCodeActionCommands ( client : LanguageClient ) : void {
6+ vscode . commands . registerCommand ( 'PowerShell.ApplyCodeActionEdits' , ( edit : any ) => {
7+ console . log ( "Applying edits" ) ;
8+ console . log ( edit ) ;
9+
10+ var workspaceEdit = new vscode . WorkspaceEdit ( ) ;
11+ workspaceEdit . set (
12+ vscode . Uri . file ( edit . File ) ,
13+ [
14+ new vscode . TextEdit (
15+ new vscode . Range (
16+ edit . StartLineNumber - 1 ,
17+ edit . StartColumnNumber - 1 ,
18+ edit . EndLineNumber - 1 ,
19+ edit . EndColumnNumber - 1 ) ,
20+ edit . Text )
21+ ] ) ;
22+ vscode . workspace . applyEdit ( workspaceEdit ) ;
23+ } ) ;
24+ }
Original file line number Diff line number Diff line change 55'use strict' ;
66
77import vscode = require( 'vscode' ) ;
8-
98import { Logger , LogLevel } from './logging' ;
109import { IFeature } from './feature' ;
1110import { SessionManager } from './session' ;
You can’t perform that action at this time.
0 commit comments