Skip to content
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

createWebview with same id should error out #44665

Closed
octref opened this issue Feb 27, 2018 · 2 comments
Closed

createWebview with same id should error out #44665

octref opened this issue Feb 27, 2018 · 2 comments
Assignees
Labels
api webview Webview issues

Comments

@octref
Copy link
Contributor

octref commented Feb 27, 2018

Testing #44466

For this extension:

import * as vscode from 'vscode';
import * as path from 'path';
import * as fs from 'fs';

export function activate(context: vscode.ExtensionContext) {
  const htmlPath = path.resolve(context.extensionPath, 'media/index.html');

  vscode.commands.registerCommand('extension.sayHello', () => {
    const wv = vscode.window.createWebview(vscode.Uri.parse('foo:bar'), vscode.ViewColumn.Three, {});
    wv.html = fs.readFileSync(htmlPath, 'utf-8');
    wv.title = 'hello'
  });
}

Running the command sayHello multiple times, you end up with multiple webviews open but only the first one being updated.

@octref
Copy link
Contributor Author

octref commented Feb 27, 2018

Also try running the command for a few times consecutively. Webviews after the first editor are blank at first. You need to switch away from them and then focus them again to see any content.

@mjbvz mjbvz added the webview Webview issues label Feb 28, 2018
@mjbvz
Copy link
Collaborator

mjbvz commented Mar 20, 2018

No longer applicable with ea1fed9. Webviews are now private objects owned by the extension that creates them. It is up to the extension to manage their ids

@mjbvz mjbvz closed this as completed Mar 20, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api webview Webview issues
Projects
None yet
Development

No branches or pull requests

2 participants