Messages
| Name | Type | Description |
|---|---|---|
| name | string | |
| disambiguator | string | |
| suffix | Suffix | NOTE: If you add new fields here, make sure to update the prepareSlot() function responsible for parsing symbols. |
| Number | Name | Description |
|---|---|---|
| 0 | UnspecifiedSuffix | |
| 1 | Namespace | Unit of code abstraction and/or namespacing. Corresponds to a package in Go and JVM languages. |
| 1 | Package | Deprecated — use Namespace instead. |
| 2 | Type | |
| 3 | Term | |
| 4 | Method | |
| 5 | TypeParameter | |
| 6 | Parameter | |
| 7 | Meta | Can be used for any purpose. |
| 8 | Local | |
| 9 | Macro |
Represents a diagnostic, such as a compiler error or warning, which should be reported for a document.
| Name | Type | Description |
|---|---|---|
| severity | Severity | Should this diagnostic be reported as an error, warning, info, or hint? |
| code | string | (optional) Code of this diagnostic, which might appear in the user interface. |
| message | string | Message of this diagnostic. |
| source | string | (optional) Human-readable string describing the source of this diagnostic, e.g. typescript or super lint. |
| tags | repeated DiagnosticTag |
Document defines the metadata about a source file on disk.
| Name | Type | Description |
|---|---|---|
| language | string | The 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_path | string | (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. |
| occurrences | repeated Occurrence | Occurrences that appear in this file. |
| symbols | repeated SymbolInformation | Symbols that are "defined" within this document, including symbols with no definition that are defined by another symbol (see Relationship.is_definition). |
| text | string | (optional) Text contents of this document. Indexers are not expected to include the text by default. |
| position_encoding | PositionEncoding | Specifies the encoding used for source ranges in this document. |
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.
| Name | Type | Description |
|---|---|---|
| metadata | Metadata | Metadata about this index. |
| documents | repeated Document | Documents that belong to this index. |
| external_symbols | repeated SymbolInformation | (optional) Symbols referenced from this index but defined in an external package. Leave empty if the external package will be indexed separately. |
| Name | Type | Description |
|---|---|---|
| version | ProtocolVersion | Which version of this protocol was used to generate this index? |
| tool_info | ToolInfo | Information about the tool that produced this index. |
| project_root | string | URI-encoded absolute path to the root directory of this index. All documents must appear in a subdirectory of this root. |
| text_document_encoding | TextEncoding | Text encoding of the source files on disk referenced from Document.relative_path. Unrelated to Document.text, which is always UTF-8. |
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.
| Name | Type | Description |
|---|---|---|
| range | repeated 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.
|
| symbol | string | (optional) The symbol that appears at this position. See SymbolInformation.symbol for formatting. |
| symbol_roles | int32 | (optional) Bitset of SymbolRoles in this occurrence. |
| override_documentation | repeated string | (optional) CommonMark-formatted documentation for this specific range, overriding Symbol.documentation. Useful for generic functions or typed assignments. |
| syntax_kind | SyntaxKind | (optional) Syntax highlighting class for this range. |
| diagnostics | repeated Diagnostic | (optional) Diagnostics reported for this specific range. |
| enclosing_range | repeated 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. |
Unit of packaging and distribution. Corresponds to a module in Go and JVM languages.
| Name | Type | Description |
|---|---|---|
| manager | string | |
| name | string | |
| version | string |
| Name | Type | Description |
|---|---|---|
| symbol | string | |
| is_reference | bool | When 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_implementation | bool | Similar to is_reference but for "Find implementations". Often both is_implementation and is_reference are true, but not always. |
| is_type_definition | bool | Similar to is_reference but for "Go to type definition". |
| is_definition | bool | Overrides "Go to definition" and "Find references" behavior for symbols without their own definition or with multiple potential definitions. |
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.
<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>)? ').'
| Name | Type | Description |
|---|---|---|
| scheme | string | |
| package | Package | |
| descriptors | repeated Descriptor |
SymbolInformation defines metadata about a symbol, such as its docstring or defining package.
| Name | Type | Description |
|---|---|---|
| symbol | string | Identifier of this symbol, referenced from Occurrence.symbol. Must be formatted according to the Symbol grammar. |
| documentation | repeated string | (optional, strongly recommended) Markdown-formatted documentation. Use signature_documentation for signatures; this field should contain only prose docstrings. |
| relationships | repeated Relationship | (optional) Relationships to other symbols (e.g., implements, type definition). |
| kind | Kind | The kind of this symbol. Prefer this over SymbolDescriptor.Suffix for determining class vs. method etc. |
| display_name | string | (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_documentation | Document | (optional) The signature as displayed in API docs or hover tooltips, e.g. void add(int a, int b). |
| enclosing_symbol | string | (optional) The enclosing symbol for local symbols. Allows local symbols to appear in symbol hierarchies for API documentation. |
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.
| Number | Name | Description |
|---|---|---|
| 0 | UnspecifiedKind | |
| 66 | AbstractMethod | A method which may or may not have a body. For Java, Kotlin etc. |
| 72 | Accessor | For Ruby's attr_accessor |
| 1 | Array | |
| 2 | Assertion | For Alloy |
| 3 | AssociatedType | |
| 4 | Attribute | For C++ |
| 5 | Axiom | For Lean |
| 6 | Boolean | |
| 7 | Class | |
| 86 | Concept | For C++ |
| 8 | Constant | |
| 9 | Constructor | |
| 62 | Contract | For Solidity |
| 10 | DataFamily | For Haskell |
| 73 | Delegate | For C# and F# |
| 11 | Enum | |
| 12 | EnumMember | |
| 63 | Error | |
| 13 | Event | |
| 84 | Extension | For Dart |
| 14 | Fact | For Alloy |
| 15 | Field | |
| 16 | File | |
| 17 | Function | |
| 18 | Getter | For get in Swift, attr_reader in Ruby |
| 19 | Grammar | For Raku |
| 20 | Instance | For Purescript and Lean |
| 21 | Interface | |
| 22 | Key | |
| 23 | Lang | For Racket |
| 24 | Lemma | For Lean |
| 64 | Library | For Solidity |
| 25 | Macro | |
| 26 | Method | |
| 74 | MethodAlias | For Ruby |
| 27 | MethodReceiver | Analogous to ThisParameter/SelfParameter for Go, where the receiver has no conventional name. |
| 67 | MethodSpecification | Analogous to AbstractMethod for Go. |
| 28 | Message | For Protobuf |
| 85 | Mixin | For Dart |
| 65 | Modifier | For Solidity |
| 29 | Module | |
| 30 | Namespace | |
| 31 | Null | |
| 32 | Number | |
| 33 | Object | |
| 34 | Operator | |
| 35 | Package | |
| 36 | PackageObject | |
| 37 | Parameter | |
| 38 | ParameterLabel | |
| 39 | Pattern | For Haskell's PatternSynonyms |
| 40 | Predicate | For Alloy |
| 41 | Property | |
| 42 | Protocol | Analogous to Trait/TypeClass for Swift and Objective-C |
| 68 | ProtocolMethod | Analogous to AbstractMethod for Swift and Objective-C. |
| 69 | PureVirtualMethod | Analogous to AbstractMethod for C++. |
| 43 | Quasiquoter | For Haskell |
| 44 | SelfParameter | self in Python, Rust, Swift etc. |
| 45 | Setter | For set in Swift, attr_writer in Ruby |
| 46 | Signature | For Alloy, analogous to Struct |
| 75 | SingletonClass | For Ruby |
| 76 | SingletonMethod | Analogous to StaticMethod for Ruby. |
| 77 | StaticDataMember | Analogous to StaticField for C++ |
| 78 | StaticEvent | For C# |
| 79 | StaticField | For C# |
| 80 | StaticMethod | For Java, C#, C++ etc. |
| 81 | StaticProperty | For C#, TypeScript etc. |
| 82 | StaticVariable | For C, C++ |
| 48 | String | |
| 49 | Struct | |
| 47 | Subscript | For Swift |
| 50 | Tactic | For Lean |
| 51 | Theorem | For Lean |
| 52 | ThisParameter | this in JavaScript, C++, Java etc. |
| 53 | Trait | Analogous to Protocol/TypeClass for Rust, Scala etc. |
| 70 | TraitMethod | Analogous to AbstractMethod for Rust, Scala etc. |
| 54 | Type | Data type definition for languages like OCaml which use type rather than separate keywords like struct and enum. |
| 55 | TypeAlias | |
| 56 | TypeClass | Analogous to Trait/Protocol for Haskell, Purescript etc. |
| 71 | TypeClassMethod | Analogous to AbstractMethod for Haskell, Purescript etc. |
| 57 | TypeFamily | For Haskell |
| 58 | TypeParameter | |
| 59 | Union | For C, C++, Cap'n Proto |
| 60 | Value | |
| 61 | Variable |
| Name | Type | Description |
|---|---|---|
| name | string | Name of the indexer that produced this index. |
| version | string | Version of the indexer that produced this index. |
| arguments | repeated string | Command-line arguments used to invoke this indexer. |
Enumerations
| Number | Name | Description |
|---|---|---|
| 0 | UnspecifiedDiagnosticTag | |
| 1 | Unnecessary | |
| 2 | Deprecated |
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).
| Number | Name | Notes |
|---|---|---|
| 0 | UnspecifiedLanguage | |
| 60 | ABAP | |
| 96 | Apex | |
| 49 | APL | |
| 39 | Ada | |
| 45 | Agda | |
| 86 | AsciiDoc | |
| 58 | Assembly | |
| 66 | Awk | |
| 68 | Bat | |
| 81 | BibTeX | |
| 34 | C | |
| 59 | COBOL | |
| 35 | CPP | C++ — name chosen for LSP consistency |
| 26 | CSS | |
| 1 | CSharp | |
| 8 | Clojure | |
| 21 | Coffeescript | |
| 9 | CommonLisp | |
| 47 | Coq | |
| 97 | CUDA | |
| 3 | Dart | |
| 57 | Delphi | |
| 88 | Diff | |
| 80 | Dockerfile | |
| 50 | Dyalog | |
| 17 | Elixir | |
| 18 | Erlang | |
| 42 | FSharp | |
| 65 | Fish | |
| 24 | Flow | |
| 56 | Fortran | |
| 91 | Git_Commit | |
| 89 | Git_Config | |
| 92 | Git_Rebase | |
| 33 | Go | |
| 98 | GraphQL | |
| 7 | Groovy | |
| 30 | HTML | |
| 20 | Hack | |
| 90 | Handlebars | |
| 44 | Haskell | |
| 46 | Idris | |
| 72 | Ini | |
| 51 | J | |
| 75 | JSON | |
| 6 | Java | |
| 22 | JavaScript | |
| 93 | JavaScriptReact | |
| 76 | Jsonnet | |
| 55 | Julia | |
| 109 | Justfile | |
| 4 | Kotlin | |
| 83 | LaTeX | |
| 48 | Lean | |
| 27 | Less | |
| 12 | Lua | |
| 108 | Luau | |
| 79 | Makefile | |
| 84 | Markdown | |
| 52 | Matlab | |
| 110 | Nickel | nickel-lang.org |
| 77 | Nix | |
| 41 | OCaml | |
| 36 | Objective_C | |
| 37 | Objective_CPP | |
| 99 | Pascal | |
| 19 | PHP | |
| 70 | PLSQL | |
| 13 | Perl | |
| 67 | PowerShell | |
| 71 | Prolog | |
| 100 | Protobuf | |
| 15 | Python | |
| 54 | R | |
| 11 | Racket | |
| 14 | Raku | |
| 62 | Razor | |
| 102 | Repro | Internal language for testing SCIP |
| 85 | ReST | |
| 16 | Ruby | |
| 40 | Rust | |
| 61 | SAS | |
| 29 | SCSS | |
| 43 | SML | |
| 69 | SQL | |
| 28 | Sass | |
| 5 | Scala | |
| 10 | Scheme | |
| 64 | ShellScript | Bash |
| 78 | Skylark | |
| 107 | Slang | |
| 95 | Solidity | |
| 106 | Svelte | |
| 2 | Swift | |
| 101 | Tcl | |
| 73 | TOML | |
| 82 | TeX | |
| 103 | Thrift | |
| 23 | TypeScript | |
| 94 | TypeScriptReact | |
| 104 | Verilog | |
| 105 | VHDL | |
| 63 | VisualBasic | |
| 25 | Vue | |
| 53 | Wolfram | |
| 31 | XML | |
| 32 | XSL | |
| 74 | YAML | |
| 38 | Zig |
Encoding used to interpret the character value in source ranges.
| Number | Name | Description |
|---|---|---|
| 0 | UnspecifiedPositionEncoding | Default. Should not be used by new indexers so that consumers can process the index without ambiguity. |
| 1 | UTF8CodeUnitOffsetFromLineStart | Offset in UTF-8 bytes. Use for indexers in Go, Rust, or C++. |
| 2 | UTF16CodeUnitOffsetFromLineStart | Offset in UTF-16 code units (2 bytes each). Use for indexers in JVM/.NET languages or JavaScript/TypeScript. |
| 3 | UTF32CodeUnitOffsetFromLineStart | Offset in UTF-32 code units (4 bytes each). Use for indexers in Python. |
| Number | Name | Description |
|---|---|---|
| 0 | UnspecifiedProtocolVersion |
| Number | Name | Description |
|---|---|---|
| 0 | UnspecifiedSeverity | |
| 1 | Error | |
| 2 | Warning | |
| 3 | Information | |
| 4 | Hint |
Declares what "role" a symbol has in an occurrence, encoded as a bitset.
To test a role: (role & SymbolRole.Import) > 0.
| Number | Name | Description |
|---|---|---|
| 0 | UnspecifiedSymbolRole | Exists only to avoid a Protobuf code generator error. |
| 1 | Definition | Is the symbol defined here? If not, this is a reference. |
| 2 | Import | Is the symbol imported here? |
| 4 | WriteAccess | Is the symbol written here? |
| 8 | ReadAccess | Is the symbol read here? |
| 16 | Generated | Is the symbol in generated code? |
| 32 | Test | Is the symbol in test code? |
| 64 | ForwardDefinition | Is 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. |
| Number | Name | Description |
|---|---|---|
| 0 | UnspecifiedSyntaxKind | |
| 1 | Comment | Comment, including comment markers and text |
| 2 | PunctuationDelimiter | ; . , |
| 3 | PunctuationBracket | () {} [] when used syntactically |
| 4 | Keyword | if, else, return, class, etc. |
| 5 | IdentifierOperator | +, *, etc. |
| 6 | Identifier | Non-specific catch-all for any identifier not better described elsewhere |
| 7 | IdentifierBuiltin | Identifiers built in to the language: min, print in Python |
| 8 | IdentifierNull | Identifiers representing null-like values: None in Python, nil in Go |
| 9 | IdentifierConstant | xyz in const xyz = "hello" |
| 10 | IdentifierMutableGlobal | var X = "hello" in Go |
| 11 | IdentifierParameter | Parameter definition and references |
| 12 | IdentifierLocal | Identifiers for variable definitions and references within a local scope |
| 13 | IdentifierShadowed | Identifiers that shadow other identifiers in an outer scope |
| 14 | IdentifierNamespace | Unit of code abstraction/namespacing — package in Go/JVM, module in Python/JavaScript |
| 15 | IdentifierFunction | Function references, including calls |
| 16 | IdentifierFunctionDefinition | Function definition only |
| 17 | IdentifierMacro | Macro references, including invocations |
| 18 | IdentifierMacroDefinition | Macro definition only |
| 19 | IdentifierType | Non-builtin types |
| 20 | IdentifierBuiltinType | Builtin types only, such as str in Python or int in Go |
| 21 | IdentifierAttribute | Python decorators, C-like __attribute__ |
| 22 | RegexEscape | \b |
| 23 | RegexRepeated | *, + |
| 24 | RegexWildcard | . |
| 25 | RegexDelimiter | ( ) [ ] |
| 26 | RegexJoin | |, - |
| 27 | StringLiteral | Literal strings: "Hello, world!" |
| 28 | StringLiteralEscape | Non-regex escapes: \t, \n |
| 29 | StringLiteralSpecial | Datetimes within strings, special words, {} in format strings |
| 30 | StringLiteralKey | "key" in { "key": "value" }, useful in JSON |
| 31 | CharacterLiteral | 'c' in languages that differentiate strings and characters |
| 32 | NumericLiteral | Literal numbers, both floats and integers |
| 33 | BooleanLiteral | true, false |
| 34 | Tag | Used for XML-like tags |
| 35 | TagAttribute | Attribute name in XML-like tags |
| 36 | TagDelimiter | Delimiters for XML-like tags |
| Number | Name | Description |
|---|---|---|
| 0 | UnspecifiedTextEncoding | |
| 1 | UTF8 | |
| 2 | UTF16 |