Platform:

Getting started

What are IDE features?

Definitions of “IDE” (integrated development environment) vary, but it’s common to think of an IDE as a code editor that offers deep integration with a specific language or technical stack.

A cross-language editor like Pulsar has built-in support for a couple dozen languages and can be extended to support more. But “support,” in this case, means syntax highlighting, indentation hinting, code folding, and the ability to apply all these features to files of one or more specific extensions. Some language packages can also identify symbols in the current file — method names and other important sections.

Pulsar needs external help for deeper integration such as the following:

But for most mainstream languages, that external help already exists!

What are language servers?

A language server is a “brain” designed to supply all the logic needed to support features like those listed above.

For a given language, instead of writing a specific deep integration with each commonly used code editor in the world, it’s easier to write one deep integration that abides by the Language Server Protocol. Each editor can then write its own adapter to communicate according to that protocol.

The Language Server Protocol therefore functions as “middleware”: each language community can write a language server in whatever way they please, with whatever tools they want, as long as it fulfills its end of the protocol. Likewise, every code editor can write a language client that implements the other half of the protocol, then wires it up to the specific features that editor can support.

This reduces vendor lock-in and makes it easier for the Pulsars of the world to offer IDE-like features.

Why do we need language servers?

Some of the features listed above have been able to be delivered through various means even without language servers. For example, Pulsar has builtin packages for CSS and HTML autocompletion because, given a document and a cursor position, it’s comparatively easy to understand which kinds of suggestions would be contextually valid. But even these packages use techniques that aren’t as robust as what a language server can provide.

Also, language servers are exciting because they offer a way for a single piece of software to meet the needs of many different IDE features at once. Lots of the IDE features mentioned above rely on the same code analysis techniques, so it only makes sense for one tool to do all the analysis within your project and deliver all these features at once.

How do I get them?

Using language servers in Pulsar is a two-step process:

  1. First, verify that a language server exists for the language you want to use.
  2. Next, find (or create) a Pulsar package that integrates with that language server.

Find a language server for your techology stack

The Language Server Project site maintains a list of known language servers for various languages and frameworks. Often you’ll see more than one language server on that page for the same language! But it’s typically enough simply to verify that at least one server exists for your language.

Search the package registry for an IDE package for your language

Packages that integrate with language servers are named according to convention. If you’re looking for an IDE package for a given language, search for ide-[language] in the package registry.

Suppose you use a language foo. You may find an ide-foo package in the repository; this would’ve been written for Atom and may be several years old by now, but may still work to some extent.

Some newer packages exist, however, that are named with pulsar- at the front. So if you see one called pulsar-ide-foo, install that instead; these tend to be IDE packages written specifically for Pulsar which have a wider set of features.

In some cases, the package might specify the name of the language server rather than the name of the language. One example is pulsar-ide-clangd, which is named after Clangd, the language server for C/C++.

Let’s make this easy for the vast majority of you:

Be sure to read the README of the package you install. Some of these packages bundle the language server; these tend to be quicker to get up and running. Others require that you install the language server yourself and help the package find its location on your system.

Why don’t all these packages simply come preinstalled with Pulsar?

Several reasons:

Still, it’s possible that some of these packages will be bundled by default in future Pulsar versions.

What if a language server exists for my language, but a Pulsar package doesn’t?

If you’ve got experience with JavaScript or have read through our package tutorials, give it a try yourself! We’ve written a tutorial for exactly this scenario.

The whole point of a language server is to reduce the implementation burden on code editors, since most of the “glue” code is shared across language servers. For that reason, we maintain a library called atom-languageclient designed to make it easy to connect a language server to Pulsar. With practice, you can do it in about a half-hour!

If you’re not comfortable writing JavaScript, reach out to us instead. Creating an IDE package for Pulsar is easier than you think! We can often coach you through the process or help you find collaborators.