What are the benefits of a building a Theia plugin compared to a VS Code extension?

Are there benefits of building a Theia plugin compared with building a VS Code plugin?
Both can be used in Theia. (A VS code plugin can even be used in VS Code of course).
For building a VS Code plugin I can find a lot of documentation and example (in the marketplace and in the documentation).
That kind of information I am missing for a Theai plugin. https://theia-ide.org/docs/authoring_plugins/

Are there special benefit why I should consider building it as Theia Plugin? Do I have more options?
These benefits can be in the way to create a plugin or in the capabilities of a plugin.

Note: this is not about the differences between Theia and VSCode, but about Theia Plugins and VSCode extensions.

[original thread by Cees Bos]

Hi @cbos, There are cases where it’s possible to implement something in either, but in other cases you have no choice and what you want to do will dictate which one you go for. I’ll give it a shot - others can complement what I missed :slight_smile:

VS Code extension(/Theia plugin): probably a little easier to develop - as you mention there are tons of tutorials and doc online to do so, and many many nice open-source examples. Soon this will be the only way to contribute language support for Theia applications, when we deprecate and remove the Language Client currently available for Theia extensions. One limitation is that VS Code extensions can only access the main app through the VS Code Extensions API, which is limited and will not permit you to do anything.

Theia extension: A little bit harder to code - e.g. may need to become familiar with Inversify.js. There is no limitation to what an extension can do - it has access to the whole application and can extend or override anything in theory, even the platform’s extensions. If what you’d like to do is not possible with the VS Code extensions API, a Theia extension may be your only, best option.

@marc-dumais I believe he’s asking the difference between theia plugins and vscode plugins, not theia extensions (if I’m not mistaken).

@vince-fugnitto you may be right - but a lot of people are confused about extensions/plugins. AFAIK we do not yet have any proper Theia Plugins, just VS Code extensions that we use in Theia.

relevant discussion: https://github.com/eclipse-theia/theia/issues/7295

Theia plugins allow to add additional APIs which are not available in VS Code, if you don’t need it and want to run in VS Code just use VS Code extensions as well. Alternative approach to add additional namespace next to vscode which allow to run in VS Code and custom Theia is discussed in the issue above.

[Jonas Helming]

I also think this question is about Theia plugins vs. VS Code extensions. In the discussion referenced by Anton above, I think consensus was reached that having a separate name space was very useful during the development, but now as ‘theia’ and ‘vscode’ are almost identical is rather confusing. I personally think nothing technical needs to be changed. However, I think (as raised on the ticket) it would be good to decide which development template to advocate for users as a default (VS Code extension vs. Theia plugin) to avoid confusion. If this decision has been made, I would be happy help identifying/fixing places where this affect the communication, e.g. in the docu and in the Yeoman templates.

[Cees Bos]

Thanks all for your clarifications.
I was aware of the difference between Theia extensions and plugins.
For some special situations we will create one or more Theia extensions.
For major part we will end up creating Theia plugins/VS Code extensions, for that part we were looking what to use.

An advantage of making a VS Code extension is that it can be published to marketplace easily like the Open VSX Registry (or a private hosted registry).
For Theia plugins it the common approach to publish it to public (or private) NPM registry, I guess?
The advantage of Open VSX compared to NPM registry is that is helpful for users to explore available plugins and start using it.

Are there also plans to publish Theia Plugins to Open VSX as well? Or is Open VSX only mend for ‘pure’ VS Code plugins?

There is no any plans as for now. I’m not certain about future of Theia plugins, see for instance: https://github.com/eclipse-theia/theia/issues/6353#issue-504609724 We want to find a way to reduce maintenance of VS Code compatibility and it can involve getting rid of Theia plugins (given that we preserve required customizations for Che). For now just consider them as technical means of brining VS Code extensions in Theia.