Skip to content

Feature/capture errors #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 25, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use panel.webview.asWebviewUri
  • Loading branch information
ShMcK committed Nov 24, 2019
commit bb4c34791519b59bbfeb42303547652078864dc1
11 changes: 6 additions & 5 deletions src/webview/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async function render(panel: vscode.WebviewPanel, rootPath: string) {

// set base href
const base: HTMLBaseElement = document.createElement('base')
base.href = panel.webview.asWebviewUri(vscode.Uri.file(rootPath)).toString() + '/'
base.href = `vscode-resource:${rootPath}/`

document.head.appendChild(base)

Expand All @@ -27,10 +27,11 @@ async function render(panel: vscode.WebviewPanel, rootPath: string) {

// generate vscode-resource build path uri
const createUri = (filePath: string): any => {
return panel.webview.asWebviewUri(vscode.Uri.file(filePath))
// .toString()
// .replace(/^\/+/g, '') // remove leading '/'
// .replace('/vscode-resource%3A', rootPath) // replace mangled resource path with root
return panel.webview
.asWebviewUri(vscode.Uri.file(filePath))
.toString()
.replace(/^\/+/g, '') // remove leading '/'
.replace('/vscode-resource%3A', rootPath) // replace mangled resource path with root
}

// fix paths for scripts
Expand Down
115 changes: 0 additions & 115 deletions src/webview/test.html

This file was deleted.