Sourcegraph comes with built-in code intelligence provided by search-based heuristics.
If you are interested in enabling precise code intelligence on your repository, see our documentation on LSIF.
Basic code intelligence implements the 3 main code intelligence features:
Basic code intelligence also filters results by file extension and by imports at the top of the file for some languages.
Basic code intelligence uses search-based heuristics, rather than parsing the code into an AST. You will see incorrect results more often for tokens with common names (such as
Get) than for tokens with more unique names simply because those tokens appear more often in the search index.
If you would like to have precise results where you are 100% confident that the definition or reference you are navigating to is for the symbol you hovered, we recommend utilizing LSIF for precise code intelligence. Even with LSIF enabled, you may occasionally see results from basic code intelligence. These scenarios are described in more detail in the LSIF docs.
Basic code intelligence supports all of the most popular programming languages.