To install srclib, follow these steps.
The srclib command-line tool is the interface to srclib.
go get -u -v sourcegraph.com/sourcegraph/srclib/cmd/srclib
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 | |||||||
... |
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!
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:
Sublime | Vim | Emacs | Atom | Eclipse | ... | |
srclib | ||||||
Python | Ruby | JS | Go | Java | C++ | ... |
$ srclib store import && srclib store defs --limit 10
)
Join the srclib mailing list to hear about support for new languages and analysis features.
srclib is 100% open source and built on other well-established open-source projects like Tern, YARD, and Jedi.