2020-06-17 08:08:42 -04:00
---
2020-07-28 14:09:36 -04:00
stage: Create
group: Source Code
info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers"
2020-06-17 08:08:42 -04:00
type: reference
---
# Code Intelligence
> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/1576) in GitLab 13.1.
Code Intelligence adds code navigation features common to interactive
development environments (IDE), including:
- Type signatures and symbol documentation.
2020-07-28 14:09:36 -04:00
- Go-to definition.
2020-06-17 08:08:42 -04:00
Code Intelligence is built into GitLab and powered by [LSIF ](https://lsif.dev/ )
(Language Server Index Format), a file format for precomputed code
intelligence data.
## Configuration
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:
```yaml
code_navigation:
2020-09-03 05:08:20 -04:00
image: sourcegraph/lsif-go:v1
2020-06-30 11:08:48 -04:00
allow_failure: true # recommended
2020-06-17 08:08:42 -04:00
script:
- lsif-go
2020-06-30 11:08:48 -04:00
artifacts:
reports:
lsif: dump.lsif
2020-06-17 08:08:42 -04:00
```
The generated LSIF file must be less than 170MiB.
After the job succeeds, code intelligence data can be viewed while browsing the code:
2020-09-04 08:08:27 -04:00
![Code intelligence ](img/code_intelligence_v13_4.png )
2020-06-17 08:08:42 -04:00
2020-08-14 08:10:01 -04:00
## Find references
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/217392) in GitLab 13.2.
2020-09-04 08:08:27 -04:00
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/235735) in GitLab 13.4.
2020-08-14 08:10:01 -04:00
To find where a particular object is being used, you can see links to specific lines of code
under the **References** tab:
![Find references ](img/code_intelligence_find_references_v13_3.png )
2020-06-17 08:08:42 -04:00
## Language support
Generating an LSIF file requires a language server indexer implementation for the
relevant language.
| Language | Implementation |
|---|---|
| Go | [sourcegraph/lsif-go ](https://github.com/sourcegraph/lsif-go ) |
| JavaScript | [sourcegraph/lsif-node ](https://github.com/sourcegraph/lsif-node ) |
| TypeScript | [sourcegraph/lsif-node ](https://github.com/sourcegraph/lsif-node ) |
View a complete list of [available LSIF indexers ](https://lsif.dev/#implementations-server ) on their website and
refer to their documentation to see how to generate an LSIF file for your specific language.