Show terminal on run active file

Related #25311
This commit is contained in:
Daniel Imms 2017-04-25 12:03:51 -07:00
parent 57a9937544
commit 60adf9adc7

View file

@ -295,15 +295,16 @@ export class RunActiveFileInTerminalAction extends Action {
return TPromise.as(void 0);
}
const editor = this.codeEditorService.getFocusedCodeEditor();
if (editor) {
const uri = editor.getModel().uri;
if (uri.scheme === 'file') {
instance.sendText(uri.fsPath, true);
} else {
this.messageService.show(Severity.Warning, nls.localize('workbench.action.terminal.runActiveFile.noFile', 'Only files on disk can be run in the terminal'));
}
if (!editor) {
return TPromise.as(void 0);
}
return TPromise.as(void 0);
const uri = editor.getModel().uri;
if (uri.scheme !== 'file') {
this.messageService.show(Severity.Warning, nls.localize('workbench.action.terminal.runActiveFile.noFile', 'Only files on disk can be run in the terminal'));
return TPromise.as(void 0);
}
instance.sendText(uri.fsPath, true);
return this.terminalService.showPanel();
}
}