Docs

SCIP Docs

Documentation for the SCIP Code Intelligence Protocol generated from scip.proto.

Descriptor message

NameTypeDescription
namestring
disambiguatorstring
suffixSuffixNOTE: If you add new fields here, make sure to update the prepareSlot() function responsible for parsing symbols.

Suffix (enum)

NumberNameDescription
0UnspecifiedSuffix
1NamespaceUnit of code abstraction and/or namespacing. Corresponds to a package in Go and JVM languages.
1PackageDeprecated — use Namespace instead.
2Type
3Term
4Method
5TypeParameter
6Parameter
7MetaCan be used for any purpose.
8Local
9Macro

Diagnostic message

Represents a diagnostic, such as a compiler error or warning, which should be reported for a document.

NameTypeDescription
severitySeverityShould this diagnostic be reported as an error, warning, info, or hint?
codestring(optional) Code of this diagnostic, which might appear in the user interface.
messagestringMessage of this diagnostic.
sourcestring(optional) Human-readable string describing the source of this diagnostic, e.g. typescript or super lint.
tagsrepeated DiagnosticTag

Document message

Document defines the metadata about a source file on disk.

NameTypeDescription
languagestringThe string ID for the programming language this file is written in. The Language enum contains the names of most common programming languages. This field is typed as a string to permit any programming language, including ones not specified by the Language enum.
relative_pathstring(Required) Unique path to the text document. Must be relative to Metadata.project_root, must not begin with /, must use / as separator, and must be canonical.
occurrencesrepeated OccurrenceOccurrences that appear in this file.
symbolsrepeated SymbolInformationSymbols that are "defined" within this document, including symbols with no definition that are defined by another symbol (see Relationship.is_definition).
textstring(optional) Text contents of this document. Indexers are not expected to include the text by default.
position_encodingPositionEncodingSpecifies the encoding used for source ranges in this document.

Index message

Index represents a complete SCIP index for a workspace rooted at a single directory. An Index message payload can have a large memory footprint; it is recommended to emit and consume an Index payload one field value at a time. The metadata field must appear first in the stream and only once.

NameTypeDescription
metadataMetadataMetadata about this index.
documentsrepeated DocumentDocuments that belong to this index.
external_symbolsrepeated SymbolInformation(optional) Symbols referenced from this index but defined in an external package. Leave empty if the external package will be indexed separately.

Metadata message

NameTypeDescription
versionProtocolVersionWhich version of this protocol was used to generate this index?
tool_infoToolInfoInformation about the tool that produced this index.
project_rootstringURI-encoded absolute path to the root directory of this index. All documents must appear in a subdirectory of this root.
text_document_encodingTextEncodingText encoding of the source files on disk referenced from Document.relative_path. Unrelated to Document.text, which is always UTF-8.

Occurrence message

Occurrence associates a source position with a symbol and/or highlighting information. Where possible, indexers should bundle logically related information across occurrences into a single occurrence to reduce payload sizes.

NameTypeDescription
rangerepeated int32 Half-open [start, end) range. Must be exactly 3 or 4 elements: [startLine, startCharacter, endCharacter] (same line) or [startLine, startCharacter, endLine, endCharacter]. Line numbers and characters are always 0-based.
symbolstring(optional) The symbol that appears at this position. See SymbolInformation.symbol for formatting.
symbol_rolesint32(optional) Bitset of SymbolRoles in this occurrence.
override_documentationrepeated string(optional) CommonMark-formatted documentation for this specific range, overriding Symbol.documentation. Useful for generic functions or typed assignments.
syntax_kindSyntaxKind(optional) Syntax highlighting class for this range.
diagnosticsrepeated Diagnostic(optional) Diagnostics reported for this specific range.
enclosing_rangerepeated int32(optional) Half-open source range of the nearest non-trivial enclosing AST node. Used for call hierarchies, symbol outlines, expand selection, and hover highlight ranges.

Package message

Unit of packaging and distribution. Corresponds to a module in Go and JVM languages.

NameTypeDescription
managerstring
namestring
versionstring

Relationship message

NameTypeDescription
symbolstring
is_referenceboolWhen resolving "Find references", controls which other symbols should be included. For example, an implementation of an interface method should also surface references to the interface method.
is_implementationboolSimilar to is_reference but for "Find implementations". Often both is_implementation and is_reference are true, but not always.
is_type_definitionboolSimilar to is_reference but for "Go to type definition".
is_definitionboolOverrides "Go to definition" and "Find references" behavior for symbols without their own definition or with multiple potential definitions.

Symbol message

A Symbol identifies a class, method, or local variable — similar to a URI. It has a standardized string representation using the grammar below. The list of descriptors should form a fully qualified name unique across the package. Local symbols must only be used for entities local to a Document.

Grammar
<symbol>    ::= <scheme> ' ' <package> ' ' (<descriptor>)+ | 'local ' <local-id>
<package>   ::= <manager> ' ' <package-name> ' ' <version>
<descriptor> ::= <namespace> | <type> | <term> | <method> | <type-parameter> | <parameter> | <meta> | <macro>
<namespace> ::= <name> '/'
<type>      ::= <name> '#'
<term>      ::= <name> '.'
<method>    ::= <name> '(' (<disambiguator>)? ').'
NameTypeDescription
schemestring
packagePackage
descriptorsrepeated Descriptor

SymbolInformation message

SymbolInformation defines metadata about a symbol, such as its docstring or defining package.

NameTypeDescription
symbolstringIdentifier of this symbol, referenced from Occurrence.symbol. Must be formatted according to the Symbol grammar.
documentationrepeated string(optional, strongly recommended) Markdown-formatted documentation. Use signature_documentation for signatures; this field should contain only prose docstrings.
relationshipsrepeated Relationship(optional) Relationships to other symbols (e.g., implements, type definition).
kindKindThe kind of this symbol. Prefer this over SymbolDescriptor.Suffix for determining class vs. method etc.
display_namestring(optional) The name as it should appear to the user. The symbol field is not always a reliable source due to case-insensitivity, special characters, or local symbols.
signature_documentationDocument(optional) The signature as displayed in API docs or hover tooltips, e.g. void add(int a, int b).
enclosing_symbolstring(optional) The enclosing symbol for local symbols. Allows local symbols to appear in symbol hierarchies for API documentation.

Kind (enum)

Fine-grained category of a symbol. More specific than Suffix: if two symbols share a Kind they share a Suffix, but different Suffixes imply different Kinds.

NumberNameDescription
0UnspecifiedKind
66AbstractMethodA method which may or may not have a body. For Java, Kotlin etc.
72AccessorFor Ruby's attr_accessor
1Array
2AssertionFor Alloy
3AssociatedType
4AttributeFor C++
5AxiomFor Lean
6Boolean
7Class
86ConceptFor C++
8Constant
9Constructor
62ContractFor Solidity
10DataFamilyFor Haskell
73DelegateFor C# and F#
11Enum
12EnumMember
63Error
13Event
84ExtensionFor Dart
14FactFor Alloy
15Field
16File
17Function
18GetterFor get in Swift, attr_reader in Ruby
19GrammarFor Raku
20InstanceFor Purescript and Lean
21Interface
22Key
23LangFor Racket
24LemmaFor Lean
64LibraryFor Solidity
25Macro
26Method
74MethodAliasFor Ruby
27MethodReceiverAnalogous to ThisParameter/SelfParameter for Go, where the receiver has no conventional name.
67MethodSpecificationAnalogous to AbstractMethod for Go.
28MessageFor Protobuf
85MixinFor Dart
65ModifierFor Solidity
29Module
30Namespace
31Null
32Number
33Object
34Operator
35Package
36PackageObject
37Parameter
38ParameterLabel
39PatternFor Haskell's PatternSynonyms
40PredicateFor Alloy
41Property
42ProtocolAnalogous to Trait/TypeClass for Swift and Objective-C
68ProtocolMethodAnalogous to AbstractMethod for Swift and Objective-C.
69PureVirtualMethodAnalogous to AbstractMethod for C++.
43QuasiquoterFor Haskell
44SelfParameterself in Python, Rust, Swift etc.
45SetterFor set in Swift, attr_writer in Ruby
46SignatureFor Alloy, analogous to Struct
75SingletonClassFor Ruby
76SingletonMethodAnalogous to StaticMethod for Ruby.
77StaticDataMemberAnalogous to StaticField for C++
78StaticEventFor C#
79StaticFieldFor C#
80StaticMethodFor Java, C#, C++ etc.
81StaticPropertyFor C#, TypeScript etc.
82StaticVariableFor C, C++
48String
49Struct
47SubscriptFor Swift
50TacticFor Lean
51TheoremFor Lean
52ThisParameterthis in JavaScript, C++, Java etc.
53TraitAnalogous to Protocol/TypeClass for Rust, Scala etc.
70TraitMethodAnalogous to AbstractMethod for Rust, Scala etc.
54TypeData type definition for languages like OCaml which use type rather than separate keywords like struct and enum.
55TypeAlias
56TypeClassAnalogous to Trait/Protocol for Haskell, Purescript etc.
71TypeClassMethodAnalogous to AbstractMethod for Haskell, Purescript etc.
57TypeFamilyFor Haskell
58TypeParameter
59UnionFor C, C++, Cap'n Proto
60Value
61Variable

ToolInfo message

NameTypeDescription
namestringName of the indexer that produced this index.
versionstringVersion of the indexer that produced this index.
argumentsrepeated stringCommand-line arguments used to invoke this indexer.

DiagnosticTag enum

NumberNameDescription
0UnspecifiedDiagnosticTag
1Unnecessary
2Deprecated

Language enum

Standardises names of common programming languages for the Document.language field. The primary purpose is to prevent a single language from having multiple string representations (e.g. C++ uses CPP — other representations are incompatible).

NumberNameNotes
0UnspecifiedLanguage
60ABAP
96Apex
49APL
39Ada
45Agda
86AsciiDoc
58Assembly
66Awk
68Bat
81BibTeX
34C
59COBOL
35CPPC++ — name chosen for LSP consistency
26CSS
1CSharp
8Clojure
21Coffeescript
9CommonLisp
47Coq
97CUDA
3Dart
57Delphi
88Diff
80Dockerfile
50Dyalog
17Elixir
18Erlang
42FSharp
65Fish
24Flow
56Fortran
91Git_Commit
89Git_Config
92Git_Rebase
33Go
98GraphQL
7Groovy
30HTML
20Hack
90Handlebars
44Haskell
46Idris
72Ini
51J
75JSON
6Java
22JavaScript
93JavaScriptReact
76Jsonnet
55Julia
109Justfile
4Kotlin
83LaTeX
48Lean
27Less
12Lua
108Luau
79Makefile
84Markdown
52Matlab
110Nickelnickel-lang.org
77Nix
41OCaml
36Objective_C
37Objective_CPP
99Pascal
19PHP
70PLSQL
13Perl
67PowerShell
71Prolog
100Protobuf
15Python
54R
11Racket
14Raku
62Razor
102ReproInternal language for testing SCIP
85ReST
16Ruby
40Rust
61SAS
29SCSS
43SML
69SQL
28Sass
5Scala
10Scheme
64ShellScriptBash
78Skylark
107Slang
95Solidity
106Svelte
2Swift
101Tcl
73TOML
82TeX
103Thrift
23TypeScript
94TypeScriptReact
104Verilog
105VHDL
63VisualBasic
25Vue
53Wolfram
31XML
32XSL
74YAML
38Zig

PositionEncoding enum

Encoding used to interpret the character value in source ranges.

NumberNameDescription
0UnspecifiedPositionEncodingDefault. Should not be used by new indexers so that consumers can process the index without ambiguity.
1UTF8CodeUnitOffsetFromLineStartOffset in UTF-8 bytes. Use for indexers in Go, Rust, or C++.
2UTF16CodeUnitOffsetFromLineStartOffset in UTF-16 code units (2 bytes each). Use for indexers in JVM/.NET languages or JavaScript/TypeScript.
3UTF32CodeUnitOffsetFromLineStartOffset in UTF-32 code units (4 bytes each). Use for indexers in Python.

ProtocolVersion enum

NumberNameDescription
0UnspecifiedProtocolVersion

Severity enum

NumberNameDescription
0UnspecifiedSeverity
1Error
2Warning
3Information
4Hint

SymbolRole enum

Declares what "role" a symbol has in an occurrence, encoded as a bitset. To test a role: (role & SymbolRole.Import) > 0.

NumberNameDescription
0UnspecifiedSymbolRoleExists only to avoid a Protobuf code generator error.
1DefinitionIs the symbol defined here? If not, this is a reference.
2ImportIs the symbol imported here?
4WriteAccessIs the symbol written here?
8ReadAccessIs the symbol read here?
16GeneratedIs the symbol in generated code?
32TestIs the symbol in test code?
64ForwardDefinitionIs this a signature for a symbol defined elsewhere? Applies to forward declarations in C/C++/Objective-C and val declarations in SML/OCaml interface files.

SyntaxKind enum

NumberNameDescription
0UnspecifiedSyntaxKind
1CommentComment, including comment markers and text
2PunctuationDelimiter; . ,
3PunctuationBracket() {} [] when used syntactically
4Keywordif, else, return, class, etc.
5IdentifierOperator+, *, etc.
6IdentifierNon-specific catch-all for any identifier not better described elsewhere
7IdentifierBuiltinIdentifiers built in to the language: min, print in Python
8IdentifierNullIdentifiers representing null-like values: None in Python, nil in Go
9IdentifierConstantxyz in const xyz = "hello"
10IdentifierMutableGlobalvar X = "hello" in Go
11IdentifierParameterParameter definition and references
12IdentifierLocalIdentifiers for variable definitions and references within a local scope
13IdentifierShadowedIdentifiers that shadow other identifiers in an outer scope
14IdentifierNamespaceUnit of code abstraction/namespacing — package in Go/JVM, module in Python/JavaScript
15IdentifierFunctionFunction references, including calls
16IdentifierFunctionDefinitionFunction definition only
17IdentifierMacroMacro references, including invocations
18IdentifierMacroDefinitionMacro definition only
19IdentifierTypeNon-builtin types
20IdentifierBuiltinTypeBuiltin types only, such as str in Python or int in Go
21IdentifierAttributePython decorators, C-like __attribute__
22RegexEscape\b
23RegexRepeated*, +
24RegexWildcard.
25RegexDelimiter( ) [ ]
26RegexJoin|, -
27StringLiteralLiteral strings: "Hello, world!"
28StringLiteralEscapeNon-regex escapes: \t, \n
29StringLiteralSpecialDatetimes within strings, special words, {} in format strings
30StringLiteralKey"key" in { "key": "value" }, useful in JSON
31CharacterLiteral'c' in languages that differentiate strings and characters
32NumericLiteralLiteral numbers, both floats and integers
33BooleanLiteraltrue, false
34TagUsed for XML-like tags
35TagAttributeAttribute name in XML-like tags
36TagDelimiterDelimiters for XML-like tags

TextEncoding enum

NumberNameDescription
0UnspecifiedTextEncoding
1UTF8
2UTF16