allow vscode.open to be called with a string in additon to an Uri

This commit is contained in:
Johannes Rieken
2022-02-01 15:34:12 +01:00
parent 25be28623b
commit fc1511ecd0
3 changed files with 10 additions and 8 deletions

View File

@@ -379,7 +379,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.Uri,
ApiCommandArgument.UriOrString,
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)]