Skip to content
Language Server Indexing Format implementation for Go
Go
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
export Emit item edges only once. (#22) Aug 22, 2019
log Support verbose and debug flags (#17) Aug 6, 2019
protocol Emit events (#11) Jul 31, 2019
.gitignore Initial version Jul 21, 2019
LICENSE Initial version Jul 21, 2019
README.md
cmd.go Support verbose and debug flags (#17) Aug 6, 2019
export.go Support verbose and debug flags (#17) Aug 6, 2019
go.mod Initial version Jul 21, 2019
go.sum Initial version Jul 21, 2019
main.go Support verbose and debug flags (#17) Aug 6, 2019
version.go Bump version Aug 14, 2019

README.md

Language Server Indexing Format Implementation for Go

🚨 This implementation is still in very early stage and follows the latest LSIF specification closely.

Language Server Index Format

The purpose of the Language Server Index Format (LSIF) is to define a standard format for language servers or other programming tools to dump their knowledge about a workspace. This dump can later be used to answer language server LSP requests for the same workspace without running the language server itself. Since much of the information would be invalidated by a change to the workspace, the dumped information typically excludes requests used when mutating a document. So, for example, the result of a code complete request is typically not part of such a dump.

A first draft specification can be found here.

Quickstart

  1. Download and build this program via go get github.com/sourcegraph/lsif-go.
  2. The binary lsif-go should be installed into your $GOPATH/bin directory.
  3. Make sure you have added $GOPATH/bin to your $PATH envrionment variable.
  4. Go to a root directory of a Go project, then execute lsif-go export:
➜ lsif-go export
4 package(s), 10 file(s), 597 def(s), 11521 element(s)
Processed in 770.817859ms

By default, the exporter dumps LSIF data to the file data.lsif in the working directory.

Use lsif-go -h for more information

Try it out!

Go to https://sourcegraph.com/github.com/gorilla/mux@d83b6ff/-/blob/mux.go and try to hover and jump around!

Testing Commands

  • Validate: lsif-util validate data.lsif
  • Visualize: lsif-util visualize data.lsif --distance 2 | dot -Tpng -o image.png
You can’t perform that action at this time.