-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
experiment with html-zone #13686
experiment with html-zone #13686
Conversation
@jrieken, thanks for your PR! By analyzing the history of the files in this pull request, we identified @kieferrm, @bpasero and @joaomoreno to be potential reviewers. |
To get a feel for this, add this keybinding
|
@jrieken , had a look at this and looks great. It is as discussed. Sometimes, the contents could be an image, sometimes an iFrame, and sometimes javascript code. The workflow would be as follows:
Challenges:
I'll try to have a play with the changes. Thanks |
Understood - I think the height challenge can be tackled with a two step approach. Unsure if we can measure things from the outside but a zone can be always be resized afterwards or we add a sash to them (like in reference search) My biggest current challenge is that there are layout issues with the web view. Often, for yet unknown reasons, it doesn't use its full (assigned) width. Makes me a little less positive about this... |
Yes found that, was hoping we could expose that in some form. Cheers.
Agreed. That's one of the reason why I thought we could measure it form within the zone and then pass the information back to the extension and then again pass that information to vscode... fun and games :) |
@DonJayamanne I going to merge this despite it being more or less useless. I have spent quite some time just hunting layout weirdness (depending on multiple editor, screen resolutions etc) and I'd like to hear what you experience. A snippet using this goes like this: vscode.commands.registerCommand('extension.runInNode', () => {
if (!vscode.window.activeTextEditor) {
return;
}
const {viewColumn, selection} = vscode.window.activeTextEditor;
if (!viewColumn) {
return;
}
const resource = vscode.Uri.parse('testing:foo/bar/' + Date.now());
return vscode.commands.executeCommand('_workbench.htmlZone', { editorPosition: viewColumn - 1, lineNumber: selection.active.line, resource });
});
const contentProvider = new class implements vscode.TextDocumentContentProvider {
provideTextDocumentContent(uri: vscode.Uri, token: CancellationToken): string {
return `<html>
<body style="background-color: pink;">
<h3>Hello World at ${new Date()}</h3>
</body>
</html>`;
}
} There is a very long list of things that don't work. To name a few
Again, this is to get feedback on the basics... The test would be if your zone always takes full width of the editor (as shown below) and isn't weirdly cropped on the right side |
Some experiment with embedding web views into the editor. fyi @DonJayamanne