command for open external

This commit is contained in:
Martin Aeschlimann
2020-11-18 12:57:39 +01:00
parent 02ecc884d7
commit 8513f398c4
2 changed files with 10 additions and 2 deletions

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import type * as vscode from 'vscode';
import { URI } from 'vs/base/common/uri';
import { URI, UriComponents } from 'vs/base/common/uri';
import * as typeConverters from 'vs/workbench/api/common/extHostTypeConverters';
import { CommandsRegistry, ICommandService, ICommandHandler } from 'vs/platform/commands/common/commands';
import { ITextEditorOptions } from 'vs/platform/editor/common/editor';
@@ -15,6 +15,7 @@ import { IWorkspacesService, IRecent } from 'vs/platform/workspaces/common/works
import { ILogService } from 'vs/platform/log/common/log';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { IViewDescriptorService, IViewsService, ViewVisibilityState } from 'vs/workbench/common/views';
import { IOpenerService } from 'vs/platform/opener/common/opener';
// -----------------------------------------------------------------
// The following commands are registered on both sides separately.
@@ -152,6 +153,13 @@ CommandsRegistry.registerCommand('_extensionTests.setLogLevel', function (access
}
});
CommandsRegistry.registerCommand('_workbench.openExternal', function (accessor: ServicesAccessor, uri: UriComponents, options: { allowTunneling?: boolean }) {
// TODO: discuss martin, ben where to put this
const openerService = accessor.get(IOpenerService);
openerService.open(URI.revive(uri), options);
});
CommandsRegistry.registerCommand('_extensionTests.getLogLevel', function (accessor: ServicesAccessor) {
const logService = accessor.get(ILogService);