@@ -175,23 +175,6 @@ export function createApiFactory(
};
})();
// Warn when trying to use the vscode.previewHtml command as it does not work properly in all scenarios and
// has security concerns.
constcheckCommand=(()=>{
letdone=false;
constinformOnce=()=>{
if(!done){
done=true;
window.showWarningMessage(localize('previewHtml.deprecated',"Extension '{0}' uses the 'vscode.previewHtml' command which is deprecated and will be removed soon. Please file an issue against this extension to update to use VS Code's webview API.",extension.identifier.value));
}
};
return(commandId:string)=>{
if(commandId==='vscode.previewHtml'){
informOnce();
}
returncommandId;
};
})();
// namespace: commands
constcommands:typeofvscode.commands={
...
...
@@ -232,7 +215,7 @@ export function createApiFactory(
Render the HTML of the resource in an editor view.
See [working with the HTML preview](https://code.visualstudio.com/docs/extensionAPI/vscode-api-commands#working-with-the-html-preview) for more information about the HTML preview's integration with the editor and for best practices for extension authors.
`,
args:[
{name:'uri',description:'Uri of the resource to preview.',constraint:(value:any)=>valueinstanceofURI||typeofvalue==='string'},
{name:'column',description:'(optional) Column in which to preview.',constraint:(value:any)=>typeofvalue==='undefined'||(typeofvalue==='number'&&typeoftypes.ViewColumn[value]==='string')},
{name:'label',description:'(optional) An human readable string that is used as title for the preview.',constraint:(v:any)=>typeofv==='string'||typeofv==='undefined'},
{name:'options',description:'(optional) Options for controlling webview environment.',constraint:(v:any)=>typeofv==='object'||typeofv==='undefined'}
description:'Open a folder or workspace in the current window or new window depending on the newWindow argument. Note that opening in the same window will shutdown the current extension host process and start a new one on the given folder/workspace unless the newWindow parameter is set to true.',