Installation

To install srclib, follow these steps.

1. Install srclib

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

  • Binaries: Linux amd64, Linux i386, Mac OS X (unzip and place the srclib program in your $PATH)
  • Or build from source (Go 1.5+): go get -u -v sourcegraph.com/sourcegraph/srclib/cmd/srclib

2. Install toolchains

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

Install the standard set of toolchains: srclib toolchain install go ruby javascript python

To list installed toolchains, run srclib toolchain list.


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

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.

Step 1 is to build the language analyzers. Next up, we will build the editor plugins!

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 ...
srclib
Python Ruby JS Go Java C++ ...

Get involved


srclib is currently in beta. We are fixing bugs and adding support for more languages. 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 and analysis features.

Built on

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

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