Skip to content

Commit af689af

Browse files
committed
Started on convertUriToPath and launcing the powershell_ise.exe process
1 parent 2173124 commit af689af

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/features/OpenInISE.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1-
import vscode = require('vscode');
2-
import { LanguageClient } from 'vscode-languageclient';
3-
import { RequestType, NotificationType, ResponseError } from 'vscode-jsonrpc';
1+
import vscode = require('vscode');
42
import 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
}

0 commit comments

Comments
 (0)