提交 a6e4dbd9 编写于 作者: B Benjamin Pasero

fixes #4419

上级 77dc2eea
......@@ -336,7 +336,7 @@ export class OpenToSideAction extends Action {
public static OPEN_TO_SIDE_ID = 'workbench.action.openToSide';
public static OPEN_TO_SIDE_LABEL = nls.localize('openToSide', "Open to the Side");
constructor( @IWorkbenchEditorService private editorService: IWorkbenchEditorService) {
constructor(@IWorkbenchEditorService private editorService: IWorkbenchEditorService) {
super(OpenToSideAction.OPEN_TO_SIDE_ID, OpenToSideAction.OPEN_TO_SIDE_LABEL);
this.class = 'quick-open-sidebyside';
......@@ -352,7 +352,15 @@ export class OpenToSideAction extends Action {
public run(context: any): TPromise<any> {
let entry = toEditorQuickOpenEntry(context);
if (entry) {
return this.editorService.openEditor(<EditorInput>entry.getInput(), entry.getOptions(), true);
let typedInputPromise: TPromise<EditorInput>;
let input = entry.getInput();
if (input instanceof EditorInput) {
typedInputPromise = TPromise.as(input);
} else {
typedInputPromise = this.editorService.inputToType(input);
}
return typedInputPromise.then(typedInput => this.editorService.openEditor(typedInput, entry.getOptions(), true));
}
return TPromise.as(false);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册