Code Intelligence adds code navigation features common to interactive development environments (IDE), including:
- Type signatures and symbol documentation.
- Go-to definition
Code Intelligence is built into GitLab and powered by LSIF (Language Server Index Format), a file format for precomputed code intelligence data.
Enable code intelligence for a project by adding a GitLab CI/CD job to the project’s
.gitlab-ci.yml which will generate the LSIF artifact:
code_navigation: image: golang:1.14.0 allow_failure: true # recommended script: - go get github.com/sourcegraph/lsif-go/cmd/lsif-go - lsif-go artifacts: reports: lsif: dump.lsif
The generated LSIF file must be less than 170MiB.
After the job succeeds, code intelligence data can be viewed while browsing the code:
Generating an LSIF file requires a language server indexer implementation for the relevant language.
View a complete list of available LSIF indexers on their website and refer to their documentation to see how to generate an LSIF file for your specific language.