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

command to reload a single given Webview #96242

Closed
brunoNetId opened this issue Apr 27, 2020 · 8 comments
Closed

command to reload a single given Webview #96242

brunoNetId opened this issue Apr 27, 2020 · 8 comments
Assignees
Labels
*out-of-scope Posted issue is not in scope of VS Code webview Webview issues

Comments

@brunoNetId
Copy link

Feature request for VSCode Webview Extensions.

A command already exists to reload Webviews, and one can programatically invoke it by implementing the following line:
vscode.commands.executeCommand("workbench.action.webview.reloadWebviewAction")

However, the above command reloads ALL webviews, which might be undesirable when multiple Webviews are displayed on screen.

The need requested is to have the ability to reload a specific Webview. For example to be able to identify a specfic Webview that is open, and request a reload to refresh its HTML content.

Thanks

@vscodebot
Copy link

vscodebot bot commented Apr 27, 2020

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@mjbvz mjbvz added info-needed Issue requires more information from poster webview Webview issues labels Apr 27, 2020
@mjbvz
Copy link
Collaborator

mjbvz commented Apr 27, 2020

Can you share your use case for this?

@brunoNetId
Copy link
Author

I'm developing an extension (webview-1), and I'd like to make use of an existing extension (also webview-2).

  1. Helps defining processing flows.
  2. Helps defining data transformations.

The second one runs a local Java JVM that holds state. The extension can submit data and request state to/from the JVM.

The extension I'm trying to develop defines processing flows and might launch 1) to start defining data transformations. It might submit data to the JVM, and changes would need to be refreshed on its Webview.

@mjbvz
Copy link
Collaborator

mjbvz commented Apr 27, 2020

Thanks. Does your extension control both of the webviews being developed? Also, how would your extension identify which webview to refresh? The viewType or editor group for example?

@brunoNetId
Copy link
Author

No, I only control the one I'm developing, but the user would be making use of both.
I'm relatively new to VSCode and I don't know well what the possibilities are. I did find the reload command (mentioned in the description), it's just missing to take a webview 'id' to refresh.
I was hoping the API would allow to get the list of open editors (from the explorer for instance) and pick the one corresponding to the data transformations Extension.
Thanks

@mjbvz
Copy link
Collaborator

mjbvz commented Apr 28, 2020

Related #15178

Webviews are only known to the extension that created them so they don't really have a concept of an id that other extensions can use. How about filing a feature request against the extension that provides these webviews to add an API for refreshing them?

@brunoNetId
Copy link
Author

brunoNetId commented Apr 28, 2020 via email

@mjbvz
Copy link
Collaborator

mjbvz commented Apr 28, 2020

Ok, I'll close this issue for now then since it sounds like an extension specific solution may be the way to go

@mjbvz mjbvz closed this as completed Apr 28, 2020
@mjbvz mjbvz added *out-of-scope Posted issue is not in scope of VS Code and removed info-needed Issue requires more information from poster labels Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
*out-of-scope Posted issue is not in scope of VS Code webview Webview issues
Projects
None yet
Development

No branches or pull requests

2 participants