提交 60adf9ad 编写于 作者: D Daniel Imms

Show terminal on run active file

Related #25311
上级 57a99375
......@@ -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();
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册