-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
vscode support: onview activation event doesn't work for a custom webview view #13157
Comments
@martin-fleck-at reproduced the issue on his machine |
Maybe related to #13090. |
I'd say almost certainly. Thanks. |
I've encountered this issue when trying to test #13091. While the effects are very similar to the other issue, they have independent problem sources. My findings during a short debugging session:
|
Oh wow. Very surprising indeed. Thanks for attempting to verify my issue while fixing the other one. There's no shortage of work for you Theia folks in 2024 ;-) |
BTW, on a somewhat separate but related note, does Theia not support VSCode's implicit/automatic activationEvent registration that was introduced in 1.74.0? |
@jcortell68 It does support it see #12167. The event generator for |
Yep. I get that the |
Bug Description:
When a vscode extension contributes a custom view that is a webview, and it declares an activation event for the view being opened (
onview:myviewid
), the plugin doesn't get activated when opening the view and the view shows no content.One workaround is to declare
*
as an activation event but that is obviously not ideal. We don't want the plugin activated if the user isn't going to open the view.Also, for whatever reason, the plugin is properly activated if the app launches with the view already opened. I.e., if the user restarts/refreshes the app with the view already open, then the plugin is activated and everything works as expected.
Steps to Reproduce:
View: Reset Workbench Layout
command.View > Open View... > My Webview
console.log()
that the plugin writes from it's activation event (Congratulations, your extension "myext" is now active...
). This proves that the plugin was not activated, despite having this in its package.jsonFor further proof that the activation event isn't working, change
activationEvents
so that the plugin is activated on launch unconditionally:Now try to reproduce the problem following the steps above and you'll see the empty view behavior doesn't happen.
Finally, the problem happens whether or not the custom view is in a custom view container. In the example plugin provided, a custom view container is used. But declaring the view to be within the built-in
explorer
container instead results in the same buggy behavior.Additional Information
The text was updated successfully, but these errors were encountered: