Code intelligence for 13 more languages, with first-class LSP support

By Geoffrey Gilmore on May 22, 2018


With code intelligence on Sourcegraph, you can navigate code more easily with hovers, definitions, references, implementations, etc. It's all powered by language servers based on the Language Server Protocol (LSP) standard (Microsoft's official LSP site also has more information).

Now, thanks to the amazing contributions of hundreds of developers in the LSP ecosystem, Sourcegraph 2.8 has support for 13 more languages. You can also connect any other LSP-compliant language server to Sourcegraph.

While any spec-compliant language server will work with Sourcegraph, we're focusing testing and development on 13 new languages. That brings the full list of languages with code intelligence on Sourcegraph 19, including the 6 already supported languages:

Use these new languages in Sourcegraph

  1. Install or upgrade to Sourcegraph 2.8.
  2. On Sourcegraph, in the site admin area, visit the Code intelligence page (/site-admin/code-intelligence) to see a list of all available language servers.
  3. Click Enable to enable a language server.

If you're not a site admin, ask your friendly site admin to follow these steps for you.

See documentation on using experimental language servers for more information.

Here's a GIF of the experimental C# support:

Status: experimental

This enhanced LSP support and language coverage is experimental. We'll be working with the LSP community, sponsoring maintainers, and submitting patches ourselves to improve the state of code intelligence as quickly as possible for these languages.

We'll remove the "experimental" label from a language server when we have confidence it's fast and reliable for a wide variety of codebases. In the meantime, see the caveats of experimental language servers.

To help us improve code intelligence, when using Sourcegraph, please report any issues you see:

  • If code intelligence isn't working on your repository, consult the language server's README for any language-specific required configuration or limitations. Treat it as though you were using an editor plugin for the language. You might need to add a config file, or slightly standardize your build system config, to make it work. It'll be worth it!
  • If the problem seems specific to the language server, report it on the language server's own issue tracker. Otherwise, report it on the Sourcegraph issue tracker (and we'll file and often fix an upstream issue if appropriate).

For more information, see "Code intelligence overview".

Notes for language server developers

For developers interested in hacking on language servers, adapting a language server for use with Sourcegraph is straightforward. It massively increases the potential audience of your language server to all developers on the web, regardless of editor and without the need to install/configure it individually. Any organization running Sourcegraph internally will be able to use it on all of their code, and we'll deploy it to Sourcegraph.com for use on all open-source code.

See how to adapt a language server for use with Sourcegraph.

We're also eager to sponsor people to build and improve open-source, LSP-based language servers. Contact us if you're interested, either as a part-time effort or to join our team as a full-time member.