add support for title object in previewHtml, #2351

This commit is contained in:
Johannes Rieken
2016-06-02 09:04:36 +02:00
parent a24a923840
commit 11544263c4
2 changed files with 10 additions and 6 deletions

View File

@@ -151,10 +151,11 @@ class ExtHostApiCommands {
});
this._register('vscode.previewHtml', (uri: URI, position?: vscode.ViewColumn) => {
return this._commands.executeCommand('_workbench.previewHtml', uri,
typeof position === 'number' ? typeConverters.fromViewColumn(position) : void 0);
this._register('vscode.previewHtml', (uri: URI, position?: vscode.ViewColumn, title?: { label?: string, description?: string }) => {
return this._commands.executeCommand('_workbench.previewHtml',
uri,
typeof position === 'number' && typeConverters.fromViewColumn(position),
title);
}, {
description: `
Render the html of the resource in an editor view.
@@ -172,6 +173,7 @@ class ExtHostApiCommands {
args: [
{ name: 'uri', description: 'Uri of the resource to preview.', constraint: value => value instanceof URI || typeof value === 'string' },
{ name: 'column', description: '(optional) Column in which to preview.' },
{ name: 'title', description: '(optional) An object literal defining the label and description, e.g. `{ label: "My Label" description: "My Description" }`' }
]
});