To install srclib and use it in your editor, follow these steps.

1. Install src

The src command-line tool is the interface to srclib.

2. Install toolchains

Toolchains add support for languages (JavaScript, Ruby, Go, etc.).

Install the standard set of toolchains: src toolchain install-std

You can skip languages you don't want by adding, e.g., --skip ruby.

To list installed toolchains, run src toolchain list.

3. Install an editor plugin

Install a srclib editor plugin, which provides doc lookups, find-usages, and type information with zero configuration needed (in most cases).

Interested in building a plugin for an editor srclib doesn't yet support? Let us know—we'd love to help!

Python Ruby   JS      Go     Java   C++    ...

The Problem

Right now, most people write code in editors that don't give them as much programming assistance as is possible. That's because creating an editor plugin and language analyzer for your favorite language and editor combo is a lot of work. And when you're done, your plugin only supports a single language and editor, and maybe only half the features you wanted.

Because there are no standard cross-language and cross-editor APIs and data formats, it is difficult to reuse your plugin for other languages or editors. So if there are M languages and N editors, we need to build M × N different plugins. That number gets large quickly, and so we suffer from poor developer tools.

The Solution

srclib takes care of the code analysis that underlies key assistive features such as finding usages and jumping to definitions. It exposes a command-line API and outputs data in a well defined, language-independent format.

A plugin (or other tool) built on srclib just has to consume this data format to support all languages that srclib supports. srclib is designed to be modular and extensible. New languages can be added by implementing language toolchains that output the srclib format.

srclib handles:

  • package detection,
  • global dependency resolution,
  • type inference,
  • querying the graph of definitions and references in code,
  • versioning using different VCS systems, and
  • semantic blaming
in a way that is:

  • language-independent,
  • flexible,
  • extensible, and
  • configuration-free.

Sublime Vim Emacs Atom Eclipse ...
Python Ruby JS Go Java C++ ...

Get involved

srclib is currently in beta. We are fixing bugs, adding support for more languages, and building more editor plugins on top of it. Help us out by using srclib and sending us feedback, spreading the word, or contributing code!

Use srclib as:

Subscribe and share

Join the srclib mailing list to hear about support for new languages, editors, and analysis features.

Build and contribute

srclib is 100% open source and built on other well-established open-source projects like Tern, YARD, and Jedi.

Check out the srclib docs for more info.

Join the community

Join the srclib Google Group or come meet us in person!

Brought to you by the srclib team.

@sqs, @beyang, @charles_vickery, @varunprime, @_tolli, @maikumori, @samertm