CommandRegistry in a back-end contribution

Hi,

Is it possible to use the CommandRegistry to register commands in a Backend Application Contribution?

Somehow, I tried to inject the CommandRegistry, but I get Error: No matching bindings found for serviceIdentifier: CommandRegistry at runtime.

I’d like to send an info that only the back-end knows about to my front end contribution.

Is this possible at all?

@drochgenius thank you for the discussion, while CommandRegistry does exist in common (which is accessible by browser, node and common code based on our code organization, it doesn’t look like CommandRegistry is bound to the backend container like it is for browser:

browser:

node:

I’ve yet to see backend contributions actually contribute commands themselves, but communication between the frontend and backend and vice versa is possible.

Thanks for you quick response.

We are currently using commands for communication between VSCode plugins and Theia front-end contributions. In our specific case, we couldn’t get the info from the plugin because plugin activation comes too late in the app lifecycle.

In all cases, I think it would be great if the CommandRegistry was bound to a back-end contribution.

To resolve our issue, we added a static endpoint to the Express App in the BackendContribution.
This endpoint exposes the info we need, and the front-end can request it via http.
It works fine for our use case.

Thanks