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' ) ;
4
2
import Window = vscode . window ;
5
3
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
+ }
6
12
7
- export function registerOpenInISECommand ( client : LanguageClient ) : void {
13
+ export function registerOpenInISECommand ( ) : void {
8
14
var disposable = vscode . commands . registerCommand ( 'PowerShell.OpenInISE' , ( ) => {
9
15
10
16
var editor = Window . activeTextEditor ;
11
17
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 ) ;
12
22
13
23
} ) ;
14
24
}
You can’t perform that action at this time.
0 commit comments