File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 1- import vscode = require( 'vscode' ) ;
2- import { LanguageClient } from 'vscode-languageclient' ;
3- import { RequestType , NotificationType , ResponseError } from 'vscode-jsonrpc' ;
1+ import vscode = require( 'vscode' ) ;
42import Window = vscode . window ;
53
4+ function convertUriToPath ( Uri ) {
5+
6+ var result = Uri . replace ( "file://" , "" )
7+ var result = result . replace ( "/" , "\")
8+ var driveletter = result . substring ( 0 )
9+ var result = driveletter + ":" + result . substring ( 1 , - 1 )
10+
11+ }
612
7- export function registerOpenInISECommand ( client : LanguageClient ) : void {
13+ export function registerOpenInISECommand ( ) : void {
814 var disposable = vscode . commands . registerCommand ( 'PowerShell.OpenInISE' , ( ) => {
915
1016 var editor = Window . activeTextEditor ;
1117 var document = editor . document ;
18+
19+ process = require ( 'child_process' ) ;
20+ var filePath = convertUriToPath ( editor . document . uri ) ;
21+ process . exec ( "powershell_ise.exe -NoProfile -File " + filePath ) ;
1222
1323 } ) ;
1424}
You can’t perform that action at this time.
0 commit comments