You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Execute the following sample code of VS Code extension.
A local file, sample.svg, is not displayed in WebviewEditorInset . sample.png is displayed.
In WebviewPanel, both the files are displayed.
Does this issue occur when all extensions are disabled?: Yes
import*asvscodefrom'vscode';import*aspathfrom'path';exportfunctionactivate(context: vscode.ExtensionContext){constrootUrl=vscode.Uri.file(context.extensionPath)constdisposable=vscode.commands.registerCommand('extension.helloWorld',async(args,brgs,crgs)=>{if(!vscode.window.activeTextEditor){return;}constinset=vscode.window.createWebviewTextEditorInset(vscode.window.activeTextEditor,0,30,{localResourceRoots: [rootUrl]});inset.onDidDispose(()=>{console.log('WEBVIEW disposed...');});inset.webview.html=getHtml(rootUrl);/* the following works well. const panel = vscode.window.createWebviewPanel( 'catCoding', 'Cat Coding', vscode.ViewColumn.One, { localResourceRoots: [ rootUrl ] } ); panel.webview.html = getHtml(rootUrl); */});context.subscriptions.push(disposable);}functiongetHtml(rootUrl: vscode.Uri){constpng=rootUrl.with({scheme: 'vscode-resource',path: path.join(rootUrl.path,'./sample.png')}).toString()constsvg=rootUrl.with({scheme: 'vscode-resource',path: path.join(rootUrl.path,'./sample.svg')}).toString()return`<img src="${png}"/><img src="${svg}"/>`}// this method is called when your extension is deactivatedexportfunctiondeactivate(){}
The text was updated successfully, but these errors were encountered:
Steps to Reproduce:
sample.svg
, is not displayed inWebviewEditorInset
.sample.png
is displayed.Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: