VSC Code Extension from sources


I wrote VS Code extension to support language server. I can confirm it’s working if I run it in Hosted Plugin Instance.
I have no idea though how to include it in base Theia instance (one started with yarn start).
I’ve tried adding it into dependencies, but no luck. Plugins is in node_modules, but does not seem to be loaded.
How can I enforce load of that plugin alongside with other VS Code plugins located in plugins folder.

Preferable I don’t want to package plugin. I want it in a form of package with package.json and code in .ts file.

Maybe I should write Theia Extension somehow loading that plugin?

@Delwing I’m not sure it is possible to consume the extension in both Theia applications and VS Code without packaging the extension. If you are looking to simply start the extension then you may use the same hosted plugin functionality found in Theia.

I wrote it with Theia in mind (VS Code is nice addition, I can live with being force to package it or so).
My motivation to write that was info that LanguageContribution etc. are going to be deprecated. I previously had it as Theia extension.
All deprecations notes pointed to VS Code plugin guidelines.

I don’t completely understand your reference about Theia hosted plugin. Let’s say I rewrite it to Theia plugin (which shouldn’t be hard, since if I understand they are kind of superset of VS Code plugins). Will including Theia plugin as dependency (in similar manner as an extension will be enough)?
Guide in docs only covers running plugin with Hosted Runner.


@Delwing as you mentioned, @theia language extensions are deprecated since 1.4.0 in favor of re-using vscode extensions (plugins). If you’d like to provide language smartness it would need to be in the form of a vscode or theia plugin (although I have not yet created a theia language plugin).

In order to consume the extension as part of your application it will need to be packaged appropriately as a plugin (generally a .vsix). Plugins are not build time dependencies, they are runtime, and therefore cannot be referenced similarly to theia dependencies in the package.json. If you’d like to include certain plugins by default in your own custom application you will need to reference them under theiaPlugins section of the package.json where they are downloaded and placed under a common plugins folder which is referenced when the app is started:

Additional information regarding the distribution of plugins and different use-cases can be viewed in the following discussion: https://github.com/eclipse-theia/theia/discussions/8664

So basically my only option is to package plugin anyway and copy it into plugins directory?

That’s a bummer, that there is no way to add language support without packaging VS Code extension.
But this is something I can include in process, package and copy, so I would be able to live with that.

Additionally extensions that I have working in hosted runner and VS Code doesn’t work in Theia
Both extension and Theia do have vscode-languageclient as dependency.