Theia Update — Extensions, Git Support & More

Sven Efftinge
TypeFox
Published in
4 min readOct 19, 2017

Back in May, we announced a new open-source IDE framework for build Desktop & Cloud IDEs implemented in TypeScript. Since then, Theia has become more mature and feature rich, approaching its BETA release on December 6.

During the last couple of months, the Theia developers (we count 19 contributors so far with two companies backing up the development) have been busy laying out important groundwork as well as implementing features. In this post, I want to give you an overview of the current state.

Extension System

Besides being able to run both a desktop and a cloud IDE from the same source code, an extendable platform has been one of the primary motivations for Theia. We had mainly two requirements:

  • Extensions should be first class citizens
    An extension should be able to contribute and change any aspect of a Theia-based application. The goal really is to allow developers to compose custom products from extensions. Therefore, in Theia, everything is an extension. So even in the core, we eat our own dog food. This is different to e.g. VS Code which runs extensions in an isolated sandbox with only a limited API exposed.
  • Discover and Install Extensions
    The other requirement was to allow users to change the set of installed extensions at runtime, by searching a registry/marketplace and installing/updating/removing extensions. This is very common, but e.g. Eclipse Che does not support such a feature yet.

The extension system has been one of the most important tasks, as it lays out how future development can scale and an eco-system can grow. Therefore another important goal was to make it as simple as possible and rely on existing knowledge and widely used concepts.

Theia extensions are regular Node.js packages which you publish to npmjs.or or another npm registry. To turn your package into a Theia extension, you only need to add minimal information to the package.json. At the core, we use dependency injection (InversifyJS) to wire the contributions from all extensions together. Theia comes with a CLI tool that makes it easy to create an application from a list of extensions.

The dynamic part that allows to install and uninstall extensions at runtime, really just changes the list of extensions and runs the CLI again. When an extension has been successfully installed it informs the user that the application has been updated and restarted. After a quick reload the new extensions is ready to be used.

Furthermore, for extension developers we’ve created a small Yeoman generator that gets you started with the initial project setup. You can find more detailed documentation here.

[/fusion_text][fusion_youtube id=”1SwQbOL4gdQ” width=”720" height=”390" autoplay=”false” api_params=”&rel=0" class=”” /][fusion_text]

Git Support

Another new extension is the Git extension, that supports the user to author commits and execute basic git commands. It is very similar to the git support in VS Code, so you can

  • see the list of local and staged changes,
  • open diff editors to see more details and
  • execute standard git operations.

Under the hood, the extension uses GitHub’s dugite library, which we extended a bit.

Here’s a short screencast showing it in action:

[/fusion_text][fusion_youtube id=”4J98UYvPkmM” width=”720" height=”390" autoplay=”false” api_params=”&rel=0" class=”” /][fusion_text]

Language Tooling

Intelligent support for languages is one of the main features an IDE absolutely needs to have. With Theia, we decided to primarily support the Language Server Protocol. By integrating the awesome Monaco editor, which also drives VS Code, we already have an excellent foundation. Today, Theia has full support for the LSP and we even have additional extensions for some languages. For instance, in Java one can navigate to files contained in jars.

All 46 available language servers will work fine in Theia, we just haven’t wrapped all of them in a Theia extension for easy consumption, yet. As of today, the following languages are supported:

  • Java
  • JavaScript / TypeScript
  • Python
  • C/C++ (Clangd in development)
  • Go
  • YANG

The list of features Theia supports includes:

  • content assist
  • find references
  • go to definition
  • diagnostics (incl. a problems-view listing all of them)
  • outline
  • quick outline
  • hover
  • signature help
  • formatting
  • rename refactoring
  • syntax coloring
  • folding
  • bracket matching
  • toggle comment
  • code lenses

There are many more important editing features, provided by Monaco, such as moving lines, multi cursor support and so on. Also, Theia has gained lots of other smaller nice goodies, like the quick command palette, preference support or the open file command.

[caption id=”attachment_14451" align=”alignnone” width=”720"]

Quick Open in Theia[/caption]

Furthermore, the colleagues from Ericsson are actively working on managing processes, debugging support and other useful extensions.

Summary

Theia has advanced to a solid foundation for future browser and desktop IDEs. If you were looking for an easy-to-use, open-source framework to build extendable IDEs, you can consider Theia now.

Have a look at the backlog to get an idea of what we want to accomplish in the next weeks.

Besides using Theia for your own projects/products we are welcoming any kind of contribution. If you want to get involved with Theia, please ping us on GitHub or Gitter (or StackOverflow, Twitter, etc.). There are many fun things to work on and some are explicitly marked for starting contributors.

Let us know what you think!

--

--