Language support
See which code features Sourcegraph supports for each language.
Code Search finds text in files of any language. These features depend on the language of a file:
- Syntax highlighting: Colors code in the file view and in search results.
- Symbol search: Finds declarations with
type:symbolsearches and lists them in the symbol sidebar. - Search-based navigation: Go to definition and Find references from search heuristics, with no setup.
- Syntactic navigation: More accurate navigation from syntax analysis, on instances that enable it.
- Precise navigation: Compiler-accurate navigation from a SCIP index that an indexer creates for the repository.
- Auto-indexing: Sourcegraph detects the project and runs the indexer itself.
Languages with full support
These languages have precise navigation, the most accurate Code Navigation:
| Language | Syntax highlighting | Symbol search | Search-based navigation | Syntactic navigation | Precise navigation | Auto-indexing |
|---|---|---|---|---|---|---|
| C | ✓ | ✓ | ✓ | ✓ | ✓ | |
| C# | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| C++ | ✓ | ✓ | ✓ | ✓ | ✓ | |
| CUDA | ✓ | ✓ | ✓ | ✓ | ||
| Go | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Java | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| JavaScript | ✓ | ✓ | ✓ | ✓ | ✓ | |
| Kotlin | ✓ | ✓ | ✓ | ✓ | ✓ | |
| Python | ✓ | ✓ | ✓ | ✓ | ✓ | |
| Ruby | ✓ | ✓ | ✓ | ✓ | ✓ | |
| Rust | ✓ | ✓ | ✓ | ✓ | ✓ | |
| Scala | ✓ | ✓ | ✓ | ✓ | ✓ | |
| TSX | ✓ | ✓ | ✓ | ✓ | ✓ | |
| TypeScript | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Visual Basic .NET | ✓ | ✓ | ✓ |
Precise navigation for Scala needs a scip-java release before 0.13.
Languages with partial support
These languages have no syntactic navigation, precise navigation, or auto-indexing:
| Language | Syntax highlighting | Symbol search | Search-based navigation |
|---|---|---|---|
| ActionScript | ✓ | ||
| Apex | ✓ | ✓ | ✓ |
| AppleScript | ✓ | ||
| ASP.NET | ✓ | ||
| BASIC | ✓ | ||
| Batchfile | ✓ | ||
| BibTeX | ✓ | ||
| Cap'n Proto | ✓ | ||
| Classic ASP | ✓ | ||
| Clojure | ✓ | ✓ | ✓ |
| CMake | ✓ | ||
| COBOL | ✓ | ✓ | ✓ |
| Common Lisp | ✓ | ✓ | ✓ |
| Crontab | ✓ | ||
| CSS | ✓ | ✓ | |
| D | ✓ | ✓ | |
| Dart | ✓ | ✓ | |
| Diff | ✓ | ||
| DM | ✓ | ||
| Dockerfile | ✓ | ||
| Elixir | ✓ | ✓ | ✓ |
| Elm | ✓ | ✓ | |
| Emacs Lisp | ✓ | ✓ | |
| Erlang | ✓ | ✓ | ✓ |
| F# | ✓ | ||
| Fish | ✓ | ||
| Forth | ✓ | ||
| Gherkin | ✓ | ||
| Git Attributes | ✓ | ||
| Git Commit | ✓ | ||
| Git Config | ✓ | ||
| GLSL | ✓ | ||
| Go Checksums | ✓ | ||
| Go Module | ✓ | ||
| GraphQL | ✓ | ✓ | ✓ |
| Graphviz (DOT) | ✓ | ||
| Groovy | ✓ | ✓ | ✓ |
| Hack | ✓ | ✓ | |
| Haml | ✓ | ||
| Haskell | ✓ | ✓ | ✓ |
| HCL, Terraform | ✓ | ||
| HLSL | ✓ | ||
| HTML | ✓ | ||
| HTML+EEX | ✓ | ||
| HTML+ERB | ✓ | ||
| Ignore List | ✓ | ||
| INI | ✓ | ||
| Java Properties | ✓ | ||
| Java Server Pages | ✓ | ||
| JavaScript+ERB | ✓ | ||
| JCL | ✓ | ||
| JSON | ✓ | ||
| Jsonnet | ✓ | ✓ | ✓ |
| Julia | ✓ | ||
| Less | ✓ | ✓ | |
| Literate Haskell | ✓ | ||
| Lua | ✓ | ✓ | ✓ |
| Magik | ✓ | ✓ | |
| Makefile | ✓ | ||
| Markdown | ✓ | ✓ | |
| MATLAB | ✓ | ✓ | |
| Maven POM | ✓ | ||
| Move | ✓ | ||
| Nickel | ✓ | ||
| Ninja | ✓ | ||
| Nix | ✓ | ||
| Objective-C | ✓ | ✓ | ✓ |
| Objective-C++ | ✓ | ✓ | |
| OCaml | ✓ | ✓ | ✓ |
| Pascal | ✓ | ✓ | ✓ |
| Perl | ✓ | ✓ | ✓ |
| PHP | ✓ | ✓ | ✓ |
| Pkl | ✓ | ✓ | |
| PostScript | ✓ | ||
| PowerShell | ✓ | ✓ | ✓ |
| Protocol Buffers | ✓ | ✓ | ✓ |
| Puppet | ✓ | ||
| R | ✓ | ✓ | ✓ |
| Raku | ✓ | ||
| Regular Expression | ✓ | ||
| reStructuredText | ✓ | ||
| Rocq Prover (Coq) | ✓ | ||
| Roff | ✓ | ||
| RPM Spec | ✓ | ||
| Sass | ✓ | ✓ | |
| Scheme | ✓ | ✓ | |
| SCSS | ✓ | ✓ | |
| Shell | ✓ | ✓ | ✓ |
| Smalltalk | ✓ | ||
| Smarty | ✓ | ||
| Solidity | ✓ | ||
| SQL | ✓ | ||
| Starlark | ✓ | ✓ | |
| Strato | ✓ | ||
| Stylus | ✓ | ||
| Svelte | ✓ | ✓ | |
| Swift | ✓ | ✓ | ✓ |
| SystemVerilog | ✓ | ✓ | ✓ |
| Tcl | ✓ | ✓ | ✓ |
| TeX, LaTeX | ✓ | ||
| Textile | ✓ | ||
| Thrift | ✓ | ✓ | ✓ |
| TOML | ✓ | ||
| Verilog | ✓ | ✓ | ✓ |
| VHDL | ✓ | ✓ | ✓ |
| Vim Script | ✓ | ✓ | |
| Vue | ✓ | ||
| Vyper | ✓ | ||
| Wikitext | ✓ | ||
| Windows Registry Entries | ✓ | ||
| XML | ✓ | ||
| XML Property List | ✓ | ||
| YAML | ✓ | ||
| Zig | ✓ | ✓ | ✓ |
Files in a language without a checkmark for syntax highlighting are shown as plain text. Administrators can assign file extensions and path patterns to a language with syntaxHighlighting.languages in the site configuration.
Formats highlighted as another language
These formats have syntax highlighting only, using the grammar of the language they are based on:
| Highlighted as | Formats |
|---|---|
| Clojure | edn |
| Groovy | Gradle |
| INI | EditorConfig, NPM Config |
| JSON | Ecere Projects, JSON with Comments, JSONLD, Jupyter Notebook |
| Kotlin | Gradle Kotlin DSL |
| Perl | Pod |
| PHP | HTML+PHP |
| Python | Cython, Easybuild, Snakemake |
| Roff | Roff Manpage |
| SQL | PLSQL, PLpgSQL, SQLPL, TSQL |
| Shell | Gentoo Ebuild, Gentoo Eclass |
| XML | Ant Build System, COLLADA, SVG, XPages, XProc, XSLT |
| YAML | BuildStream, Kaitai Struct, RAML, Unity3D Asset |