theia: VSCode extension with HTML part broken
Description
The TLA+ VSCode extension has rendering issues with Theia and Theia fails completely with the extension’s HTML part.
Gitpod with hash f5d7d65f-bdab-4f57-994b-3ad1539792bb was created from this TLA+ spec.
Reproduction Steps

In VSCode

/cc @alygin
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (11 by maintainers)
@akosyakov, you’ve spotted it correctly,
appendCodeLinkChild()won’t add the<a>element if the last parameter is empty.I guess, this issue can be closed. All the problems are either fixed or covered in other specialised issues. @lemmy?
@alygin I’ve tried, it does not work for me, looking at the code, this part looks suspicious:
asWebviewUrireturns an external URI to load local content, in remote context it is something likehttp://webview-host/vscode-resource/file/.... The point is that you cannot read filesystem with that and you should not. The extension is always running on the workspace machine and you can just dofs.readFileSync(path.join(path.join(extContext.extensionPath, 'resources', 'check-result-view.html')), 'utf8');.Important that within the webview resources should be loaded using links created by
asWebviewUri.Sure, here it is: vscode-tlaplus-1.2.1.vsix.zip
with #6465:
It does not look good because the extension is not designed to work remotely. It uses vscode-resource scheme as a csp source: https://github.com/alygin/vscode-tlaplus/blob/f1fb18ef796181f42ab74b3fc53b2d976ba9edec/resources/check-result-view.html#L5
It does not work when resources are served from the remote http endpoint. It has to be fixed to use
webview.cspSourceas described in VS Code docs: https://code.visualstudio.com/api/extension-guides/webview#content-security-policy