@@ -36,13 +36,13 @@ export class RefactorProxy extends vscode.Disposable {
3636 this . _process = null ;
3737 }
3838 extractVariable < T > ( document : vscode . TextDocument , name : string , filePath : string , range : vscode . Range ) : Promise < T > {
39- let command = ` {"lookup":"extract_variable", "file":"${ filePath } ", "start":" ${ document . offsetAt ( range . start ) } " , "end":" ${ document . offsetAt ( range . end ) } " , "id":"1", "name":"${ name } "}` ;
40- return this . sendCommand < T > ( command , REFACTOR . ExtractVariable ) ;
39+ let command = { "lookup" :"extract_variable" , "file" :` "${ filePath } "` , "start" :document . offsetAt ( range . start ) . toString ( ) , "end" :document . offsetAt ( range . end ) . toString ( ) , "id" :"1" , "name" :` "${ name } "` } ;
40+ return this . sendCommand < T > ( JSON . stringify ( command ) , REFACTOR . ExtractVariable ) ;
4141 }
4242 extractMethod < T > ( document : vscode . TextDocument , name : string , filePath : string , range : vscode . Range ) : Promise < T > {
43- let command = ` {"lookup":"extract_method", "file":"${ filePath } ", "start":" ${ document . offsetAt ( range . start ) } " , "end":" ${ document . offsetAt ( range . end ) } " , "id":"1","name":"${ name } "}` ;
44- return this . sendCommand < T > ( command , REFACTOR . ExtractVariable ) ;
45- }
43+ let command = { "lookup" :"extract_method" , "file" :` "${ filePath } "` , "start" :document . offsetAt ( range . start ) . toString ( ) , "end" :document . offsetAt ( range . end ) . toString ( ) , "id" :"1" , "name" :` "${ name } "` } ;
44+ return this . sendCommand < T > ( JSON . stringify ( command ) , REFACTOR . ExtractVariable ) ;
45+ }
4646 private sendCommand < T > ( command : string , telemetryEvent : string ) : Promise < T > {
4747 let timer = new Delays ( ) ;
4848 return this . initialize ( this . pythonSettings . pythonPath ) . then ( ( ) => {
0 commit comments