Skip to content

Consuming Builtin and External VS Code Extensions

Vincent Fugnitto edited this page Feb 26, 2020 · 4 revisions

Description

The project has made substantial efforts in improving VS Code extension support. For this reason, language-specific extensions in Theia are deprecated and are instead replaced by builtin VS Code extensions. The main reasons for using pre-existing extensions are the following:

  • Increased functionality (including new commands, preferences, features).
  • Better support (VS Code are the contributors for the builtins and the extensions are well tested and feature-rich).
  • Less overall maintenance for the project.

Migration Steps

The following are migration steps for any applications who wish to use builtin extensions:

  1. Remove any deprecated extensions (extensions listed in the following pull-request should be removed unless maintained by external sources.
  2. Include the necessary plugin dependencies:
"@theia/plugin-dev": "latest",
"@theia/plugin-ext": "latest",
"@theia/plugin-ext-vscode": "latest",
  1. In your application's package.json, you can add the location of where you want plugins to be located (the default value is plugins):
"theiaPluginsDir": "plugins",
  1. In your application's package.json, you can list the plugins you want to be downloaded by providing a unique quantifier and a URL location (for example, the project uses .vsix files published under a repo's GitHub releases tab)
"theiaPlugins": {
    "vscode-builtin-bat": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/bat-1.39.1-prel.vsix",
    "vscode-builtin-clojure": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/clojure-1.39.1-prel.vsix",
    "vscode-builtin-coffeescript": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/coffeescript-1.39.1-prel.vsix",
    "vscode-builtin-configuration-editing": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/configuration-editing-1.39.1-prel.vsix",
    "vscode-builtin-cpp": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/cpp-1.39.1-prel.vsix",
    "vscode-builtin-csharp": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/csharp-1.39.1-prel.vsix"
}
  1. Plugins can be downloaded using the new theia download:plugins script provided by the @theia/cli extension. For example:
"scripts": {
  "prepare": "yarn build && yarn download:plugins",
  "build": "theia rebuild:electron && theia build",
  "start": "electron scripts/theia-electron-main.js",
  "package": "electron-builder",
  "package:preview": "electron-builder --dir",
  "download:plugins": "theia download:plugins"
},

Additional Examples

You can also take a look at examples from theia-apps as images have been updated to include builtin and external extensions.