We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cf21f5d commit 020f755Copy full SHA for 020f755
src/features/Console.ts
@@ -25,13 +25,15 @@ export function registerConsoleCommands(client: LanguageClient): void {
25
26
vscode.commands.registerCommand('PowerShell.RunSelection', () => {
27
var editor = vscode.window.activeTextEditor;
28
-
29
- client.sendRequest(EvaluateRequest.type, {
+ var start = editor.selection.start;
+ var end = editor.selection.end;
30
+ if(editor.selection.isEmpty){
31
+ start = new vscode.Position(start.line, 0)
32
+ }
33
+ client.sendRequest(EvaluateRequest.type, {
34
expression:
35
editor.document.getText(
- new vscode.Range(
- editor.selection.anchor,
- editor.selection.active))
36
+ new vscode.Range(start, end))
37
});
38
39
0 commit comments