This commit is contained in:
Joao Moreno
2018-12-03 15:15:29 +01:00
parent e7c77a3a81
commit a8b004a30e

View File

@@ -24,6 +24,8 @@ import { ExtHostContext, ExtHostEditorsShape, IApplyEditsOptions, IExtHostContex
import { EditorViewColumn, editorGroupToViewColumn, viewColumnToEditorGroup } from 'vs/workbench/api/shared/editor';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService';
import { IURLService } from 'vs/platform/url/common/url';
import product from 'vs/platform/node/product';
export class MainThreadTextEditors implements MainThreadTextEditorsShape {
@@ -264,6 +266,7 @@ CommandsRegistry.registerCommand('_workbench.open', function (accessor: Services
const editorService = accessor.get(IEditorService);
const editorGroupService = accessor.get(IEditorGroupsService);
const openerService = accessor.get(IOpenerService);
const urlService = accessor.get(IURLService);
const [resource, options, position, label] = args;
@@ -277,6 +280,10 @@ CommandsRegistry.registerCommand('_workbench.open', function (accessor: Services
return Promise.resolve(void 0);
}
if (resource && (resource.scheme === product.urlProtocol || /^vscode/.test(resource.scheme))) {
return urlService.open(resource).then(_ => void 0);
}
// finally, delegate to opener service
return openerService.open(resource).then(_ => void 0);
});