This commit is contained in:
Johannes Rieken
2022-02-01 18:35:02 +01:00
parent 09c2e177ea
commit 7d1f0fda8b
3 changed files with 14 additions and 5 deletions

View File

@@ -19,6 +19,8 @@ import { TransientCellMetadata, TransientDocumentMetadata } from 'vs/workbench/c
import { ITextEditorOptions } from 'vs/platform/editor/common/editor';
import { VSBuffer } from 'vs/base/common/buffer';
import { decodeSemanticTokensDto } from 'vs/editor/common/services/semanticTokensDto';
import { matchesSomeScheme } from 'vs/platform/opener/common/opener';
import { Schemas } from 'vs/base/common/network';
//#region --- NEW world
@@ -379,7 +381,7 @@ const newCommands: ApiCommand[] = [
new ApiCommand(
'vscode.open', '_workbench.open', 'Opens the provided resource in the editor. Can be a text or binary file, or an http(s) URL. If you need more control over the options for opening a text file, use vscode.window.showTextDocument instead.',
[
ApiCommandArgument.UriOrString,
new ApiCommandArgument<URI | string>('uriOrString', 'Uri-instance or string (only http/https)', v => URI.isUri(v) || (typeof v === 'string' && matchesSomeScheme(v, Schemas.http, Schemas.https)), v => v),
new ApiCommandArgument<vscode.ViewColumn | typeConverters.TextEditorOpenOptions | undefined, [vscode.ViewColumn?, ITextEditorOptions?] | undefined>('columnOrOptions', 'Either the column in which to open or editor options, see vscode.TextDocumentShowOptions',
v => v === undefined || typeof v === 'number' || typeof v === 'object',
v => !v ? v : typeof v === 'number' ? [typeConverters.ViewColumn.from(v), undefined] : [typeConverters.ViewColumn.from(v.viewColumn), typeConverters.TextEditorOpenOptions.from(v)]