Is activationEvents honored for sidebars?

I’m starting a small extension project for a new sidebar. I only really want it to be available for certain types of projects, but a simple condition on testing for a file doesn’t work:

    "activationEvents": [
        "onWorkspaceContains:hello.md"
    ],

It appears the extension always gets activated no matter what conditions are in the activationEvents section of extensions.json. Is that a bug or expected / undocumented behavior?

(checking other extensions with sidebars like Go-Bee shows their sidebars also to be available always)

1 Like

At, yeah. This is a point we should clarify in the docs. Certain extension features always cause the extension to load. One being sidebars, because if they didn’t it might cause sidebar layouts to change unexpectedly on the user if one suddenly wasn’t present for a project.

Another is commands in the menus, although only when invoked by the user for the first time. They’re always present on the menu, though.

ah, ok that makes sense then! thanks for clarifying

actually, thinking about it: I don’t think unactivated plugins would change the users sidebar layouts not change unexpectedly - I would expect it to be handled the same as in development of the plug-in when it’s not activated, right?

Screenshot 2024-03-31 at 12.04.23

Yeah, that totally makes sense. We could not start up the JavaScript code but display a placeholder similar to the above that lets users trigger it manually if wanted.