cg-code-graph 0.10.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. cg_code_graph-0.10.1.dist-info/METADATA +678 -0
  2. cg_code_graph-0.10.1.dist-info/RECORD +174 -0
  3. cg_code_graph-0.10.1.dist-info/WHEEL +5 -0
  4. cg_code_graph-0.10.1.dist-info/entry_points.txt +3 -0
  5. cg_code_graph-0.10.1.dist-info/licenses/LICENSE +21 -0
  6. cg_code_graph-0.10.1.dist-info/top_level.txt +1 -0
  7. codegraph/__init__.py +2 -0
  8. codegraph/aitools.py +129 -0
  9. codegraph/apps.py +76 -0
  10. codegraph/blindspots.py +428 -0
  11. codegraph/bridges.py +1701 -0
  12. codegraph/cli.py +725 -0
  13. codegraph/concepts.py +362 -0
  14. codegraph/config.py +559 -0
  15. codegraph/core/__init__.py +0 -0
  16. codegraph/core/cache.py +375 -0
  17. codegraph/core/detect.py +80 -0
  18. codegraph/core/extractors.py +187 -0
  19. codegraph/core/fsutil.py +61 -0
  20. codegraph/core/generated.py +575 -0
  21. codegraph/core/model.py +174 -0
  22. codegraph/core/paths.py +175 -0
  23. codegraph/core/plugin.py +160 -0
  24. codegraph/core/store.py +80 -0
  25. codegraph/core/syntax_errors.py +132 -0
  26. codegraph/coverage.py +928 -0
  27. codegraph/doctor.py +453 -0
  28. codegraph/external.py +613 -0
  29. codegraph/indexer.py +336 -0
  30. codegraph/link.py +434 -0
  31. codegraph/lint_async.py +524 -0
  32. codegraph/mcp_server.py +1303 -0
  33. codegraph/parity.py +473 -0
  34. codegraph/parity_structure.py +307 -0
  35. codegraph/payload.py +321 -0
  36. codegraph/plans.py +1285 -0
  37. codegraph/platform_scan.py +643 -0
  38. codegraph/platforms.py +1369 -0
  39. codegraph/plugins/__init__.py +0 -0
  40. codegraph/plugins/cfamily/__init__.py +0 -0
  41. codegraph/plugins/cfamily/plugin.py +930 -0
  42. codegraph/plugins/cfamily/syntax.py +881 -0
  43. codegraph/plugins/dart/__init__.py +0 -0
  44. codegraph/plugins/dart/bridges.py +345 -0
  45. codegraph/plugins/dart/extractor/bin/extract.dart +717 -0
  46. codegraph/plugins/dart/extractor/pubspec.lock +149 -0
  47. codegraph/plugins/dart/extractor/pubspec.yaml +7 -0
  48. codegraph/plugins/dart/http.py +904 -0
  49. codegraph/plugins/dart/models.py +308 -0
  50. codegraph/plugins/dart/plugin.py +625 -0
  51. codegraph/plugins/dart/program.py +907 -0
  52. codegraph/plugins/django/__init__.py +0 -0
  53. codegraph/plugins/django/extras.py +378 -0
  54. codegraph/plugins/django/models.py +508 -0
  55. codegraph/plugins/django/plugin.py +728 -0
  56. codegraph/plugins/django/schemas.py +339 -0
  57. codegraph/plugins/django/shapes.py +216 -0
  58. codegraph/plugins/django/urls.py +603 -0
  59. codegraph/plugins/express/__init__.py +0 -0
  60. codegraph/plugins/express/plugin.py +428 -0
  61. codegraph/plugins/flutter/__init__.py +0 -0
  62. codegraph/plugins/flutter/plugin.py +538 -0
  63. codegraph/plugins/kotlin/__init__.py +0 -0
  64. codegraph/plugins/kotlin/exact.py +457 -0
  65. codegraph/plugins/kotlin/plugin.py +1961 -0
  66. codegraph/plugins/kotlin/reparse.py +234 -0
  67. codegraph/plugins/laravel/__init__.py +0 -0
  68. codegraph/plugins/laravel/broadcast.py +351 -0
  69. codegraph/plugins/laravel/plugin.py +863 -0
  70. codegraph/plugins/laravel/tests.py +262 -0
  71. codegraph/plugins/laravel/values.py +728 -0
  72. codegraph/plugins/native/__init__.py +0 -0
  73. codegraph/plugins/native/gates.py +286 -0
  74. codegraph/plugins/native/runner.py +183 -0
  75. codegraph/plugins/native/scipread.py +194 -0
  76. codegraph/plugins/native/ts.py +54 -0
  77. codegraph/plugins/nest/__init__.py +0 -0
  78. codegraph/plugins/nest/plugin.py +654 -0
  79. codegraph/plugins/nextjs/__init__.py +0 -0
  80. codegraph/plugins/nextjs/plugin.py +336 -0
  81. codegraph/plugins/nuxt/__init__.py +0 -0
  82. codegraph/plugins/nuxt/plugin.py +308 -0
  83. codegraph/plugins/php/__init__.py +0 -0
  84. codegraph/plugins/php/extractor/composer.json +5 -0
  85. codegraph/plugins/php/extractor/composer.lock +76 -0
  86. codegraph/plugins/php/extractor/extract.php +743 -0
  87. codegraph/plugins/php/gating.py +573 -0
  88. codegraph/plugins/php/plugin.py +668 -0
  89. codegraph/plugins/php/strings.py +197 -0
  90. codegraph/plugins/python/__init__.py +0 -0
  91. codegraph/plugins/python/aitools.py +664 -0
  92. codegraph/plugins/python/external.py +245 -0
  93. codegraph/plugins/python/fields.py +107 -0
  94. codegraph/plugins/python/plugin.py +1733 -0
  95. codegraph/plugins/python/refs.py +485 -0
  96. codegraph/plugins/python/roots.py +412 -0
  97. codegraph/plugins/python/socketio.py +210 -0
  98. codegraph/plugins/python/subproc.py +864 -0
  99. codegraph/plugins/python/tests.py +1040 -0
  100. codegraph/plugins/python/values.py +179 -0
  101. codegraph/plugins/pyweb/__init__.py +0 -0
  102. codegraph/plugins/pyweb/plugin.py +1334 -0
  103. codegraph/plugins/pyweb/values.py +68 -0
  104. codegraph/plugins/rust/__init__.py +0 -0
  105. codegraph/plugins/rust/cargo.py +226 -0
  106. codegraph/plugins/rust/plugin.py +980 -0
  107. codegraph/plugins/rust/syntax.py +678 -0
  108. codegraph/plugins/scip/__init__.py +0 -0
  109. codegraph/plugins/scip/importer.py +129 -0
  110. codegraph/plugins/scip/scip.proto +962 -0
  111. codegraph/plugins/scip/scip_pb2.py +97 -0
  112. codegraph/plugins/stubs/__init__.py +0 -0
  113. codegraph/plugins/stubs/plugins.py +38 -0
  114. codegraph/plugins/swift/__init__.py +0 -0
  115. codegraph/plugins/swift/baseurl.py +109 -0
  116. codegraph/plugins/swift/exact.py +415 -0
  117. codegraph/plugins/swift/indexstore.py +209 -0
  118. codegraph/plugins/swift/packages.py +174 -0
  119. codegraph/plugins/swift/plugin.py +2890 -0
  120. codegraph/plugins/ts/__init__.py +0 -0
  121. codegraph/plugins/ts/baseurl.py +185 -0
  122. codegraph/plugins/ts/extractor/extract.mjs +2652 -0
  123. codegraph/plugins/ts/extractor/fw.mjs +685 -0
  124. codegraph/plugins/ts/extractor/package-lock.json +205 -0
  125. codegraph/plugins/ts/extractor/package.json +9 -0
  126. codegraph/plugins/ts/plugin.py +480 -0
  127. codegraph/plugins/tsweb/__init__.py +0 -0
  128. codegraph/plugins/tsweb/common.py +290 -0
  129. codegraph/plugins/tsweb/data.py +276 -0
  130. codegraph/presets/__init__.py +146 -0
  131. codegraph/presets/c_cpp.yaml +9 -0
  132. codegraph/presets/common.yaml +66 -0
  133. codegraph/presets/dart.yaml +9 -0
  134. codegraph/presets/django-ninja.yaml +15 -0
  135. codegraph/presets/django.yaml +25 -0
  136. codegraph/presets/djangorestframework.yaml +17 -0
  137. codegraph/presets/express.yaml +17 -0
  138. codegraph/presets/kotlin.yaml +11 -0
  139. codegraph/presets/laravel.yaml +40 -0
  140. codegraph/presets/nest.yaml +11 -0
  141. codegraph/presets/nextjs.yaml +15 -0
  142. codegraph/presets/nuxt.yaml +9 -0
  143. codegraph/presets/php.yaml +5 -0
  144. codegraph/presets/python.yaml +10 -0
  145. codegraph/presets/rust.yaml +5 -0
  146. codegraph/presets/swift.yaml +10 -0
  147. codegraph/presets/typescript.yaml +13 -0
  148. codegraph/process_runs.py +328 -0
  149. codegraph/protocols/__init__.py +299 -0
  150. codegraph/protocols/builtin.py +67 -0
  151. codegraph/protocols/matchers.py +144 -0
  152. codegraph/protocols/view.py +334 -0
  153. codegraph/query.py +2089 -0
  154. codegraph/realtime.py +260 -0
  155. codegraph/roundtrip.py +346 -0
  156. codegraph/routes.py +442 -0
  157. codegraph/starters.py +218 -0
  158. codegraph/tests_index.py +117 -0
  159. codegraph/viz/__init__.py +0 -0
  160. codegraph/viz/graph.py +369 -0
  161. codegraph/viz/server.py +198 -0
  162. codegraph/viz/static/app.css +148 -0
  163. codegraph/viz/static/app.js +1082 -0
  164. codegraph/viz/static/index.html +81 -0
  165. codegraph/viz/static/layered.js +237 -0
  166. codegraph/viz/static/vendor/VERSIONS.txt +4 -0
  167. codegraph/viz/static/vendor/cose-base.js +3214 -0
  168. codegraph/viz/static/vendor/cytoscape-fcose.js +1549 -0
  169. codegraph/viz/static/vendor/cytoscape.min.js +31 -0
  170. codegraph/viz/static/vendor/layout-base.js +5230 -0
  171. codegraph/viz/tools/package-lock.json +303 -0
  172. codegraph/viz/tools/package.json +7 -0
  173. codegraph/viz/tools/shoot.mjs +165 -0
  174. codegraph/xcode.py +251 -0
@@ -0,0 +1,962 @@
1
+ // An index contains one or more pieces of information about a given piece of
2
+ // source code or software artifact. Complementary information can be merged
3
+ // together from multiple sources to provide a unified code intelligence
4
+ // experience.
5
+ //
6
+ // Programs producing a file of this format is an "indexer" and may operate
7
+ // somewhere on the spectrum between precision, such as indexes produced by
8
+ // compiler-backed indexers, and heurstics, such as indexes produced by local
9
+ // syntax-directed analysis for scope rules.
10
+
11
+ syntax = "proto3";
12
+
13
+ package scip;
14
+
15
+ option go_package = "github.com/scip-code/scip/bindings/go/scip/";
16
+ option java_multiple_files = true;
17
+ option java_outer_classname = "ScipProto";
18
+ option java_package = "org.scip_code.scip";
19
+
20
+ // Index represents a complete SCIP index for a workspace this is rooted at a
21
+ // single directory. An Index message payload can have a large memory footprint
22
+ // and it's therefore recommended to emit and consume an Index payload one field
23
+ // value at a time. To permit streaming consumption of an Index payload, the
24
+ // `metadata` field must appear at the start of the stream and must only appear
25
+ // once in the stream. Other field values may appear in any order.
26
+ message Index {
27
+ // Metadata about this index.
28
+ Metadata metadata = 1;
29
+ // Documents that belong to this index.
30
+ repeated Document documents = 2;
31
+ // (optional) Symbols that are referenced from this index but are defined in
32
+ // an external package (a separate `Index` message). Leave this field empty
33
+ // if you assume the external package will get indexed separately. If the
34
+ // external package won't get indexed for some reason then you can use this
35
+ // field to provide hover documentation for those external symbols.
36
+ repeated SymbolInformation external_symbols = 3;
37
+ // IMPORTANT: When adding a new field to `Index` here, add a matching
38
+ // function in `IndexVisitor` and update `ParseStreaming`.
39
+ }
40
+
41
+ message Metadata {
42
+ // Which version of this protocol was used to generate this index?
43
+ ProtocolVersion version = 1;
44
+ // Information about the tool that produced this index.
45
+ ToolInfo tool_info = 2;
46
+ // URI-encoded absolute path to the root directory of this index. All
47
+ // documents in this index must appear in a subdirectory of this root
48
+ // directory.
49
+ string project_root = 3;
50
+ // Text encoding of the source files on disk that are referenced from
51
+ // `Document.relative_path`. This value is unrelated to the `Document.text`
52
+ // field, which is a Protobuf string and hence must be UTF-8 encoded.
53
+ TextEncoding text_document_encoding = 4;
54
+ }
55
+
56
+ enum ProtocolVersion {
57
+ UnspecifiedProtocolVersion = 0;
58
+ }
59
+
60
+ enum TextEncoding {
61
+ UnspecifiedTextEncoding = 0;
62
+ UTF8 = 1;
63
+ UTF16 = 2;
64
+ }
65
+
66
+ message ToolInfo {
67
+ // Name of the indexer that produced this index.
68
+ string name = 1;
69
+ // Version of the indexer that produced this index.
70
+ string version = 2;
71
+ // Command-line arguments that were used to invoke this indexer.
72
+ repeated string arguments = 3;
73
+ }
74
+
75
+ // Document defines the metadata about a source file on disk.
76
+ message Document {
77
+ // The string ID for the programming language this file is written in.
78
+ // The `Language` enum contains the names of most common programming languages.
79
+ // This field is typed as a string to permit any programming language, including
80
+ // ones that are not specified by the `Language` enum.
81
+ string language = 4;
82
+ // (Required) Unique path to the text document.
83
+ //
84
+ // 1. The path must be relative to the directory supplied in the associated
85
+ // `Metadata.project_root`.
86
+ // 2. The path must not begin with a leading '/'.
87
+ // 3. The path must point to a regular file, not a symbolic link.
88
+ // 4. The path must use '/' as the separator, including on Windows.
89
+ // 5. The path must be canonical; it cannot include empty components ('//'),
90
+ // or '.' or '..'.
91
+ string relative_path = 1;
92
+ // Occurrences that appear in this file.
93
+ repeated Occurrence occurrences = 2;
94
+ // Symbols that are "defined" within this document.
95
+ //
96
+ // This should include symbols which technically do not have any definition,
97
+ // but have a reference and are defined by some other symbol (see
98
+ // Relationship.is_definition).
99
+ repeated SymbolInformation symbols = 3;
100
+
101
+ // (optional) Text contents of this document. Indexers are not expected to
102
+ // include the text by default. It's preferable that clients read the text
103
+ // contents from the file system by resolving the absolute path from joining
104
+ // `Index.metadata.project_root` and `Document.relative_path`. This field
105
+ // can be useful for testing or when working with virtual/in-memory documents.
106
+ string text = 5;
107
+
108
+ // Specifies the encoding used for source ranges in this Document.
109
+ //
110
+ // Usually, this will match the type used to index the string type
111
+ // in the indexer's implementation language in O(1) time.
112
+ // - For an indexer implemented in JVM/.NET language or JavaScript/TypeScript,
113
+ // use UTF16CodeUnitOffsetFromLineStart.
114
+ // - For an indexer implemented in Python,
115
+ // use UTF32CodeUnitOffsetFromLineStart.
116
+ // - For an indexer implemented in Go, Rust or C++,
117
+ // use UTF8ByteOffsetFromLineStart.
118
+ PositionEncoding position_encoding = 6;
119
+ }
120
+
121
+ // Encoding used to interpret the 'character' value in source ranges.
122
+ enum PositionEncoding {
123
+ // Default value. This value should not be used by new SCIP indexers
124
+ // so that a consumer can process the SCIP index without ambiguity.
125
+ UnspecifiedPositionEncoding = 0;
126
+ // The 'character' value is interpreted as an offset in terms
127
+ // of UTF-8 code units (i.e. bytes).
128
+ //
129
+ // Example: For the string "🚀 Woo" in UTF-8, the bytes are
130
+ // [240, 159, 154, 128, 32, 87, 111, 111], so the offset for 'W'
131
+ // would be 5.
132
+ UTF8CodeUnitOffsetFromLineStart = 1;
133
+ // The 'character' value is interpreted as an offset in terms
134
+ // of UTF-16 code units (each is 2 bytes).
135
+ //
136
+ // Example: For the string "🚀 Woo", the UTF-16 code units are
137
+ // ['\ud83d', '\ude80', ' ', 'W', 'o', 'o'], so the offset for 'W'
138
+ // would be 3.
139
+ UTF16CodeUnitOffsetFromLineStart = 2;
140
+ // The 'character' value is interpreted as an offset in terms
141
+ // of UTF-32 code units (each is 4 bytes).
142
+ //
143
+ // Example: For the string "🚀 Woo", the UTF-32 code units are
144
+ // ['🚀', ' ', 'W', 'o', 'o'], so the offset for 'W' would be 2.
145
+ UTF32CodeUnitOffsetFromLineStart = 3;
146
+ }
147
+
148
+ // Symbol is similar to a URI, it identifies a class, method, or a local
149
+ // variable. `SymbolInformation` contains rich metadata about symbols such as
150
+ // the docstring.
151
+ //
152
+ // Symbol has a standardized string representation, which can be used
153
+ // interchangeably with `Symbol`. The syntax for Symbol is the following:
154
+ // ```
155
+ // # (<x>)+ stands for one or more repetitions of <x>
156
+ // # (<x>)? stands for zero or one occurrence of <x>
157
+ // <symbol> ::= <scheme> ' ' <package> ' ' (<descriptor>)+ | 'local ' <local-id>
158
+ // <package> ::= <manager> ' ' <package-name> ' ' <version>
159
+ // <scheme> ::= any UTF-8, escape spaces with double space. Must not be empty nor start with 'local'
160
+ // <manager> ::= any UTF-8, escape spaces with double space. Use the placeholder '.' to indicate an empty value
161
+ // <package-name> ::= same as above
162
+ // <version> ::= same as above
163
+ // <descriptor> ::= <namespace> | <type> | <term> | <method> | <type-parameter> | <parameter> | <meta> | <macro>
164
+ // <namespace> ::= <name> '/'
165
+ // <type> ::= <name> '#'
166
+ // <term> ::= <name> '.'
167
+ // <meta> ::= <name> ':'
168
+ // <macro> ::= <name> '!'
169
+ // <method> ::= <name> '(' (<method-disambiguator>)? ').'
170
+ // <type-parameter> ::= '[' <name> ']'
171
+ // <parameter> ::= '(' <name> ')'
172
+ // <name> ::= <identifier>
173
+ // <method-disambiguator> ::= <simple-identifier>
174
+ // <identifier> ::= <simple-identifier> | <escaped-identifier>
175
+ // <simple-identifier> ::= (<identifier-character>)+
176
+ // <identifier-character> ::= '_' | '+' | '-' | '$' | ASCII letter or digit
177
+ // <escaped-identifier> ::= '`' (<escaped-character>)+ '`', must contain at least one non-<identifier-character>
178
+ // <escaped-characters> ::= any UTF-8, escape backticks with double backtick.
179
+ // <local-id> ::= <simple-identifier>
180
+ // ```
181
+ //
182
+ // The list of descriptors for a symbol should together form a fully
183
+ // qualified name for the symbol. That is, it should serve as a unique
184
+ // identifier across the package. Typically, it will include one descriptor
185
+ // for every node in the AST (along the ancestry path) between the root of
186
+ // the file and the node corresponding to the symbol.
187
+ //
188
+ // Local symbols MUST only be used for entities which are local to a Document,
189
+ // and cannot be accessed from outside the Document.
190
+ message Symbol {
191
+ string scheme = 1;
192
+ Package package = 2;
193
+ repeated Descriptor descriptors = 3;
194
+ }
195
+
196
+ // Unit of packaging and distribution.
197
+ //
198
+ // NOTE: This corresponds to a module in Go and JVM languages.
199
+ message Package {
200
+ string manager = 1;
201
+ string name = 2;
202
+ string version = 3;
203
+ }
204
+
205
+ message Descriptor {
206
+ enum Suffix {
207
+ option allow_alias = true;
208
+ UnspecifiedSuffix = 0;
209
+ // Unit of code abstraction and/or namespacing.
210
+ //
211
+ // NOTE: This corresponds to a package in Go and JVM languages.
212
+ Namespace = 1;
213
+ // Use Namespace instead.
214
+ Package = 1 [deprecated = true];
215
+ Type = 2;
216
+ Term = 3;
217
+ Method = 4;
218
+ TypeParameter = 5;
219
+ Parameter = 6;
220
+ // Can be used for any purpose.
221
+ Meta = 7;
222
+ Local = 8;
223
+ Macro = 9;
224
+ }
225
+ string name = 1;
226
+ string disambiguator = 2;
227
+ Suffix suffix = 3;
228
+ // NOTE: If you add new fields here, make sure to update the prepareSlot()
229
+ // function responsible for parsing symbols.
230
+ }
231
+
232
+ // Signature represents the signature of a symbol as it's displayed in API
233
+ // documentation or hover tooltips. It uses a subset of Document's fields with
234
+ // the same field numbers for wire compatibility with older indexes that encoded
235
+ // signatures using the Document message type.
236
+ message Signature {
237
+ // The language of the signature, e.g. "java", "go", "python".
238
+ string language = 4;
239
+ // The text content of the signature, e.g. "void add(int a, int b)".
240
+ string text = 5;
241
+ // (optional) Occurrences within the signature text that reference other
242
+ // symbols, enabling hyperlinking of types in the signature. Ranges are
243
+ // relative to the `text` field.
244
+ repeated Occurrence occurrences = 2;
245
+
246
+ // Reserved field numbers from the Document message to prevent accidental
247
+ // reuse, which would break wire compatibility with older indexes.
248
+ reserved 1, 3, 6;
249
+ }
250
+
251
+ // SymbolInformation defines metadata about a symbol, such as the symbol's
252
+ // docstring or what package it's defined it.
253
+ message SymbolInformation {
254
+ // Identifier of this symbol, which can be referenced from `Occurence.symbol`.
255
+ // The string must be formatted according to the grammar in `Symbol`.
256
+ string symbol = 1;
257
+ // (optional, but strongly recommended) The markdown-formatted documentation
258
+ // for this symbol. Use `SymbolInformation.signature_documentation` to
259
+ // document the method/class/type signature of this symbol.
260
+ // Due to historical reasons, indexers may include signature documentation in
261
+ // this field by rendering markdown code blocks. New indexers should only
262
+ // include non-code documentation in this field, for example docstrings.
263
+ repeated string documentation = 3;
264
+ // (optional) Relationships to other symbols (e.g., implements, type definition).
265
+ repeated Relationship relationships = 4;
266
+ // The kind of this symbol. Use this field instead of
267
+ // `SymbolDescriptor.Suffix` to determine whether something is, for example, a
268
+ // class or a method.
269
+ Kind kind = 5;
270
+ // (optional) Kind represents the fine-grained category of a symbol, suitable for presenting
271
+ // information about the symbol's meaning in the language.
272
+ //
273
+ // For example:
274
+ // - A Java method would have the kind `Method` while a Go function would
275
+ // have the kind `Function`, even if the symbols for these use the same
276
+ // syntax for the descriptor `SymbolDescriptor.Suffix.Method`.
277
+ // - A Go struct has the symbol kind `Struct` while a Java class has
278
+ // the symbol kind `Class` even if they both have the same descriptor:
279
+ // `SymbolDescriptor.Suffix.Type`.
280
+ //
281
+ // Since Kind is more fine-grained than Suffix:
282
+ // - If two symbols have the same Kind, they should share the same Suffix.
283
+ // - If two symbols have different Suffixes, they should have different Kinds.
284
+ enum Kind {
285
+ UnspecifiedKind = 0;
286
+ // A method which may or may not have a body. For Java, Kotlin etc.
287
+ AbstractMethod = 66;
288
+ // For Ruby's attr_accessor
289
+ Accessor = 72;
290
+ Array = 1;
291
+ // For Alloy
292
+ Assertion = 2;
293
+ AssociatedType = 3;
294
+ // For C++
295
+ Attribute = 4;
296
+ // For Lean
297
+ Axiom = 5;
298
+ Boolean = 6;
299
+ Class = 7;
300
+ // For C++
301
+ Concept = 86;
302
+ Constant = 8;
303
+ Constructor = 9;
304
+ // For Solidity
305
+ Contract = 62;
306
+ // For Haskell
307
+ DataFamily = 10;
308
+ // For C# and F#
309
+ Delegate = 73;
310
+ Enum = 11;
311
+ EnumMember = 12;
312
+ Error = 63;
313
+ Event = 13;
314
+ // For Dart
315
+ Extension = 84;
316
+ // For Alloy
317
+ Fact = 14;
318
+ Field = 15;
319
+ File = 16;
320
+ Function = 17;
321
+ // For 'get' in Swift, 'attr_reader' in Ruby
322
+ Getter = 18;
323
+ // For Raku
324
+ Grammar = 19;
325
+ // For Purescript and Lean
326
+ Instance = 20;
327
+ Interface = 21;
328
+ Key = 22;
329
+ // For Racket
330
+ Lang = 23;
331
+ // For Lean
332
+ Lemma = 24;
333
+ // For solidity
334
+ Library = 64;
335
+ Macro = 25;
336
+ Method = 26;
337
+ // For Ruby
338
+ MethodAlias = 74;
339
+ // Analogous to 'ThisParameter' and 'SelfParameter', but for languages
340
+ // like Go where the receiver doesn't have a conventional name.
341
+ MethodReceiver = 27;
342
+ // Analogous to 'AbstractMethod', for Go.
343
+ MethodSpecification = 67;
344
+ // For Protobuf
345
+ Message = 28;
346
+ // For Dart
347
+ Mixin = 85;
348
+ // For Solidity
349
+ Modifier = 65;
350
+ Module = 29;
351
+ Namespace = 30;
352
+ Null = 31;
353
+ Number = 32;
354
+ Object = 33;
355
+ Operator = 34;
356
+ Package = 35;
357
+ PackageObject = 36;
358
+ Parameter = 37;
359
+ ParameterLabel = 38;
360
+ // For Haskell's PatternSynonyms
361
+ Pattern = 39;
362
+ // For Alloy
363
+ Predicate = 40;
364
+ Property = 41;
365
+ // Analogous to 'Trait' and 'TypeClass', for Swift and Objective-C
366
+ Protocol = 42;
367
+ // Analogous to 'AbstractMethod', for Swift and Objective-C.
368
+ ProtocolMethod = 68;
369
+ // Analogous to 'AbstractMethod', for C++.
370
+ PureVirtualMethod = 69;
371
+ // For Haskell
372
+ Quasiquoter = 43;
373
+ // 'self' in Python, Rust, Swift etc.
374
+ SelfParameter = 44;
375
+ // For 'set' in Swift, 'attr_writer' in Ruby
376
+ Setter = 45;
377
+ // For Alloy, analogous to 'Struct'.
378
+ Signature = 46;
379
+ // For Ruby
380
+ SingletonClass = 75;
381
+ // Analogous to 'StaticMethod', for Ruby.
382
+ SingletonMethod = 76;
383
+ // Analogous to 'StaticField', for C++
384
+ StaticDataMember = 77;
385
+ // For C#
386
+ StaticEvent = 78;
387
+ // For C#
388
+ StaticField = 79;
389
+ // For Java, C#, C++ etc.
390
+ StaticMethod = 80;
391
+ // For C#, TypeScript etc.
392
+ StaticProperty = 81;
393
+ // For C, C++
394
+ StaticVariable = 82;
395
+ String = 48;
396
+ Struct = 49;
397
+ // For Swift
398
+ Subscript = 47;
399
+ // For Lean
400
+ Tactic = 50;
401
+ // For Lean
402
+ Theorem = 51;
403
+ // Method receiver for languages
404
+ // 'this' in JavaScript, C++, Java etc.
405
+ ThisParameter = 52;
406
+ // Analogous to 'Protocol' and 'TypeClass', for Rust, Scala etc.
407
+ Trait = 53;
408
+ // Analogous to 'AbstractMethod', for Rust, Scala etc.
409
+ TraitMethod = 70;
410
+ // Data type definition for languages like OCaml which use `type`
411
+ // rather than separate keywords like `struct` and `enum`.
412
+ Type = 54;
413
+ TypeAlias = 55;
414
+ // Analogous to 'Trait' and 'Protocol', for Haskell, Purescript etc.
415
+ TypeClass = 56;
416
+ // Analogous to 'AbstractMethod', for Haskell, Purescript etc.
417
+ TypeClassMethod = 71;
418
+ // For Haskell
419
+ TypeFamily = 57;
420
+ TypeParameter = 58;
421
+ // For C, C++, Capn Proto
422
+ Union = 59;
423
+ Value = 60;
424
+ Variable = 61;
425
+ // Next = 87;
426
+ // Feel free to open a PR proposing new language-specific kinds.
427
+ }
428
+ // (optional) The name of this symbol as it should be displayed to the user.
429
+ // For example, the symbol "com/example/MyClass#myMethod(+1)." should have the
430
+ // display name "myMethod". The `symbol` field is not a reliable source of
431
+ // the display name for several reasons:
432
+ //
433
+ // - Local symbols don't encode the name.
434
+ // - Some languages have case-insensitive names, so the symbol is all-lowercase.
435
+ // - The symbol may encode names with special characters that should not be
436
+ // displayed to the user.
437
+ string display_name = 6;
438
+ // (optional) The signature of this symbol as it's displayed in API
439
+ // documentation or in hover tooltips. For example, a Java method that adds
440
+ // two numbers would have `Signature.language = "java"` and
441
+ // `Signature.text = "void add(int a, int b)"`. The `language` and `text`
442
+ // fields are required while `occurrences` can be optionally included to
443
+ // support hyperlinking referenced symbols in the signature.
444
+ Signature signature_documentation = 7;
445
+ // (optional) The enclosing symbol if this is a local symbol. For non-local
446
+ // symbols, the enclosing symbol should be parsed from the `symbol` field
447
+ // using the `Descriptor` grammar.
448
+ //
449
+ // The primary use-case for this field is to allow local symbol to be displayed
450
+ // in a symbol hierarchy for API documentation. It's OK to leave this field
451
+ // empty for local variables since local variables usually don't belong in API
452
+ // documentation. However, in the situation that you wish to include a local
453
+ // symbol in the hierarchy, then you can use `enclosing_symbol` to locate the
454
+ // "parent" or "owner" of this local symbol. For example, a Java indexer may
455
+ // choose to use local symbols for private class fields while providing an
456
+ // `enclosing_symbol` to reference the enclosing class to allow the field to
457
+ // be part of the class documentation hierarchy. From the perspective of an
458
+ // author of an indexer, the decision to use a local symbol or global symbol
459
+ // should exclusively be determined whether the local symbol is accessible
460
+ // outside the document, not by the capability to find the enclosing
461
+ // symbol.
462
+ string enclosing_symbol = 8;
463
+ }
464
+
465
+ message Relationship {
466
+ string symbol = 1;
467
+ // When resolving "Find references", this field documents what other symbols
468
+ // should be included together with this symbol. For example, consider the
469
+ // following TypeScript code that defines two symbols `Animal#sound()` and
470
+ // `Dog#sound()`:
471
+ // ```ts
472
+ // interface Animal {
473
+ // ^^^^^^ definition Animal#
474
+ // sound(): string
475
+ // ^^^^^ definition Animal#sound()
476
+ // }
477
+ // class Dog implements Animal {
478
+ // ^^^ definition Dog#, relationships = [{symbol: "Animal#", is_implementation: true}]
479
+ // public sound(): string { return "woof" }
480
+ // ^^^^^ definition Dog#sound(), references_symbols = Animal#sound(), relationships = [{symbol: "Animal#sound()", is_implementation:true, is_reference: true}]
481
+ // }
482
+ // const animal: Animal = new Dog()
483
+ // ^^^^^^ reference Animal#
484
+ // console.log(animal.sound())
485
+ // ^^^^^ reference Animal#sound()
486
+ // ```
487
+ // Doing "Find references" on the symbol `Animal#sound()` should return
488
+ // references to the `Dog#sound()` method as well. Vice-versa, doing "Find
489
+ // references" on the `Dog#sound()` method should include references to the
490
+ // `Animal#sound()` method as well.
491
+ bool is_reference = 2;
492
+ // Similar to `is_reference` but for "Find implementations".
493
+ // It's common for `is_implementation` and `is_reference` to both be true but
494
+ // it's not always the case.
495
+ // In the TypeScript example above, observe that `Dog#` has an
496
+ // `is_implementation` relationship with `"Animal#"` but not `is_reference`.
497
+ // This is because "Find references" on the "Animal#" symbol should not return
498
+ // "Dog#". We only want "Dog#" to return as a result for "Find
499
+ // implementations" on the "Animal#" symbol.
500
+ bool is_implementation = 3;
501
+ // Similar to `references_symbols` but for "Go to type definition".
502
+ bool is_type_definition = 4;
503
+ // Allows overriding the behavior of "Go to definition" and "Find references"
504
+ // for symbols which do not have a definition of their own or could
505
+ // potentially have multiple definitions.
506
+ //
507
+ // For example, in a language with single inheritance and no field overriding,
508
+ // inherited fields can reuse the same symbol as the ancestor which declares
509
+ // the field. In such a situation, is_definition is not needed.
510
+ //
511
+ // On the other hand, in languages with single inheritance and some form
512
+ // of mixins, you can use is_definition to relate the symbol to the
513
+ // matching symbol in ancestor classes, and is_reference to relate the
514
+ // symbol to the matching symbol in mixins.
515
+ bool is_definition = 5;
516
+ // Update registerInverseRelationships on adding a new field here.
517
+ }
518
+
519
+ // SymbolRole declares what "role" a symbol has in an occurrence. A role is
520
+ // encoded as a bitset where each bit represents a different role. For example,
521
+ // to determine if the `Import` role is set, test whether the second bit of the
522
+ // enum value is defined. In pseudocode, this can be implemented with the
523
+ // logic: `const isImportRole = (role.value & SymbolRole.Import.value) > 0`.
524
+ enum SymbolRole {
525
+ // This case is not meant to be used; it only exists to avoid an error
526
+ // from the Protobuf code generator.
527
+ UnspecifiedSymbolRole = 0;
528
+ // Is the symbol defined here? If not, then this is a symbol reference.
529
+ Definition = 0x1;
530
+ // Is the symbol imported here?
531
+ Import = 0x2;
532
+ // Is the symbol written here?
533
+ WriteAccess = 0x4;
534
+ // Is the symbol read here?
535
+ ReadAccess = 0x8;
536
+ // Is the symbol in generated code?
537
+ Generated = 0x10;
538
+ // Is the symbol in test code?
539
+ Test = 0x20;
540
+ // Is this a signature for a symbol that is defined elsewhere?
541
+ //
542
+ // Applies to forward declarations for languages like C, C++
543
+ // and Objective-C, as well as `val` declarations in interface
544
+ // files in languages like SML and OCaml.
545
+ ForwardDefinition = 0x40;
546
+ }
547
+
548
+ enum SyntaxKind {
549
+ option allow_alias = true;
550
+
551
+ UnspecifiedSyntaxKind = 0;
552
+
553
+ // Comment, including comment markers and text
554
+ Comment = 1;
555
+
556
+ // `;` `.` `,`
557
+ PunctuationDelimiter = 2;
558
+ // (), {}, [] when used syntactically
559
+ PunctuationBracket = 3;
560
+
561
+ // `if`, `else`, `return`, `class`, etc.
562
+ Keyword = 4;
563
+ IdentifierKeyword = 4 [deprecated = true];
564
+
565
+ // `+`, `*`, etc.
566
+ IdentifierOperator = 5;
567
+
568
+ // non-specific catch-all for any identifier not better described elsewhere
569
+ Identifier = 6;
570
+ // Identifiers builtin to the language: `min`, `print` in Python.
571
+ IdentifierBuiltin = 7;
572
+ // Identifiers representing `null`-like values: `None` in Python, `nil` in Go.
573
+ IdentifierNull = 8;
574
+ // `xyz` in `const xyz = "hello"`
575
+ IdentifierConstant = 9;
576
+ // `var X = "hello"` in Go
577
+ IdentifierMutableGlobal = 10;
578
+ // Parameter definition and references
579
+ IdentifierParameter = 11;
580
+ // Identifiers for variable definitions and references within a local scope
581
+ IdentifierLocal = 12;
582
+ // Identifiers that shadow other identifiers in an outer scope
583
+ IdentifierShadowed = 13;
584
+ // Identifier representing a unit of code abstraction and/or namespacing.
585
+ //
586
+ // NOTE: This corresponds to a package in Go and JVM languages,
587
+ // and a module in languages like Python and JavaScript.
588
+ IdentifierNamespace = 14;
589
+ IdentifierModule = 14 [deprecated = true];
590
+
591
+ // Function references, including calls
592
+ IdentifierFunction = 15;
593
+ // Function definition only
594
+ IdentifierFunctionDefinition = 16;
595
+
596
+ // Macro references, including invocations
597
+ IdentifierMacro = 17;
598
+ // Macro definition only
599
+ IdentifierMacroDefinition = 18;
600
+
601
+ // non-builtin types
602
+ IdentifierType = 19;
603
+ // builtin types only, such as `str` for Python or `int` in Go
604
+ IdentifierBuiltinType = 20;
605
+
606
+ // Python decorators, c-like __attribute__
607
+ IdentifierAttribute = 21;
608
+
609
+ // `\b`
610
+ RegexEscape = 22;
611
+ // `*`, `+`
612
+ RegexRepeated = 23;
613
+ // `.`
614
+ RegexWildcard = 24;
615
+ // `(`, `)`, `[`, `]`
616
+ RegexDelimiter = 25;
617
+ // `|`, `-`
618
+ RegexJoin = 26;
619
+
620
+ // Literal strings: "Hello, world!"
621
+ StringLiteral = 27;
622
+ // non-regex escapes: "\t", "\n"
623
+ StringLiteralEscape = 28;
624
+ // datetimes within strings, special words within a string, `{}` in format strings
625
+ StringLiteralSpecial = 29;
626
+ // "key" in { "key": "value" }, useful for example in JSON
627
+ StringLiteralKey = 30;
628
+ // 'c' or similar, in languages that differentiate strings and characters
629
+ CharacterLiteral = 31;
630
+ // Literal numbers, both floats and integers
631
+ NumericLiteral = 32;
632
+ // `true`, `false`
633
+ BooleanLiteral = 33;
634
+
635
+ // Used for XML-like tags
636
+ Tag = 34;
637
+ // Attribute name in XML-like tags
638
+ TagAttribute = 35;
639
+ // Delimiters for XML-like tags
640
+ TagDelimiter = 36;
641
+ }
642
+
643
+ // SingleLineRange represents a half-open [start, end) range within a single line.
644
+ //
645
+ // Line numbers and characters are always 0-based. Make sure to increment them
646
+ // before displaying in an editor-like UI because editors conventionally use
647
+ // 1-based numbers. The `character` values are interpreted based on the
648
+ // `PositionEncoding` for the enclosing Document.
649
+ message SingleLineRange {
650
+ int32 line = 1;
651
+ int32 start_character = 2;
652
+ int32 end_character = 3;
653
+ }
654
+
655
+ // MultiLineRange represents a half-open [start, end) range spanning multiple lines.
656
+ //
657
+ // Line numbers and characters are always 0-based. Make sure to increment them
658
+ // before displaying in an editor-like UI because editors conventionally use
659
+ // 1-based numbers. The `character` values are interpreted based on the
660
+ // `PositionEncoding` for the enclosing Document.
661
+ //
662
+ // Producers SHOULD use `SingleLineRange` when `start_line == end_line` to keep
663
+ // indexes compact, but consumers MUST accept multi-line encoding even when the
664
+ // range happens to fit on a single line.
665
+ message MultiLineRange {
666
+ int32 start_line = 1;
667
+ int32 start_character = 2;
668
+ int32 end_line = 3;
669
+ int32 end_character = 4;
670
+ }
671
+
672
+ // Occurrence associates a source position with a symbol and/or highlighting
673
+ // information.
674
+ //
675
+ // If possible, indexers should try to bundle logically related information
676
+ // across occurrences into a single occurrence to reduce payload sizes.
677
+ //
678
+ // Range encoding:
679
+ //
680
+ // An Occurrence carries its source range in one of two ways: the deprecated
681
+ // `range` field (a `repeated int32` packed encoding kept for backward
682
+ // compatibility), or one of the typed alternatives in the `typed_range`
683
+ // oneof. New producers SHOULD set `typed_range` and SHOULD NOT set the
684
+ // deprecated `range` field. The same rule applies to `enclosing_range` and
685
+ // `typed_enclosing_range`.
686
+ //
687
+ // When both encodings are present on the same Occurrence, `typed_range` takes
688
+ // precedence over `range` (likewise `typed_enclosing_range` over
689
+ // `enclosing_range`). Producers that set both forms MUST keep them
690
+ // semantically equivalent. Consumers SHOULD prefer the typed form when
691
+ // available and fall back to the `repeated int32` form otherwise.
692
+ message Occurrence {
693
+ // Deprecated: Use `single_line_range` or `multi_line_range` instead.
694
+ //
695
+ // Half-open [start, end) range. Must be exactly three or four elements:
696
+ // - Three elements: `[startLine, startCharacter, endCharacter]` (single-line)
697
+ // - Four elements: `[startLine, startCharacter, endLine, endCharacter]`
698
+ //
699
+ // The end line of a three-element range is inferred to equal the start line.
700
+ //
701
+ // Historical note: the original draft of this schema had a `Range` message
702
+ // type with `start` and `end` fields of type `Position`, mirroring LSP.
703
+ // Benchmarks revealed that this encoding was inefficient and that we could
704
+ // reduce the total payload size of an index by 50% by using `repeated int32`
705
+ // instead. However, the lack of type safety led to the introduction of
706
+ // `single_line_range` and `multi_line_range` as typed alternatives; the
707
+ // typed encoding's per-index size overhead is small (single-digit percent)
708
+ // because ranges are only a fraction of a typical index payload.
709
+ repeated int32 range = 1 [deprecated = true];
710
+
711
+ // Half-open [start, end) source range of this occurrence.
712
+ //
713
+ // It is allowed for the range to be empty (i.e. start==end).
714
+ //
715
+ // When both `typed_range` and the deprecated `range` field are set,
716
+ // `typed_range` takes precedence.
717
+ oneof typed_range {
718
+ // Range spanning a single line.
719
+ SingleLineRange single_line_range = 8;
720
+ // Range spanning multiple lines.
721
+ MultiLineRange multi_line_range = 9;
722
+ }
723
+ // (optional) The symbol that appears at this position. See
724
+ // `SymbolInformation.symbol` for how to format symbols as strings.
725
+ string symbol = 2;
726
+ // (optional) Bitset containing `SymbolRole`s in this occurrence.
727
+ // See `SymbolRole`'s documentation for how to read and write this field.
728
+ int32 symbol_roles = 3;
729
+ // (optional) CommonMark-formatted documentation for this specific range. If
730
+ // empty, the `Symbol.documentation` field is used instead. One example
731
+ // where this field might be useful is when the symbol represents a generic
732
+ // function (with abstract type parameters such as `List<T>`) and at this
733
+ // occurrence we know the exact values (such as `List<String>`).
734
+ //
735
+ // This field can also be used for dynamically or gradually typed languages,
736
+ // which commonly allow for type-changing assignment.
737
+ repeated string override_documentation = 4;
738
+ // (optional) What syntax highlighting class should be used for this range?
739
+ SyntaxKind syntax_kind = 5;
740
+ // (optional) Diagnostics that have been reported for this specific range.
741
+ repeated Diagnostic diagnostics = 6;
742
+ // Deprecated: Use `typed_enclosing_range` instead.
743
+ //
744
+ // Uses the same `repeated int32` encoding as the deprecated `range` field.
745
+ repeated int32 enclosing_range = 7 [deprecated = true];
746
+
747
+ // (optional) Half-open source range of the nearest non-trivial enclosing AST
748
+ // node. This range must enclose the occurrence range. Example applications:
749
+ //
750
+ // - Call hierarchies: to determine what symbols are referenced from the body
751
+ // of a function
752
+ // - Symbol outline: to display breadcrumbs from the cursor position to the
753
+ // root of the file
754
+ // - Expand selection: to select the nearest enclosing AST node.
755
+ // - Highlight range: to indicate the AST expression that is associated with a
756
+ // hover popover
757
+ //
758
+ // For definition occurrences, the enclosing range should indicate the
759
+ // start/end bounds of the entire definition AST node, including
760
+ // documentation.
761
+ // ```
762
+ // const n = 3
763
+ // ^ range
764
+ // ^^^^^^^^^^^ enclosing_range
765
+ //
766
+ // /** Parses the string into something */
767
+ // ^ enclosing_range start --------------------------------------|
768
+ // function parse(input string): string { |
769
+ // ^^^^^ range |
770
+ // return input.slice(n) |
771
+ // } |
772
+ // ^ enclosing_range end <---------------------------------------|
773
+ // ```
774
+ //
775
+ // Any attributes/decorators/attached macros should also be part of the
776
+ // enclosing range.
777
+ //
778
+ // ```python
779
+ // @cache
780
+ // ^ enclosing_range start---------------------|
781
+ // def factorial(n): |
782
+ // return n * factorial(n-1) if n else 1 |
783
+ // < enclosing_range end-----------------------|
784
+ //
785
+ // ```
786
+ //
787
+ // For reference occurrences, the enclosing range should indicate the start/end
788
+ // bounds of the parent expression.
789
+ // ```
790
+ // const a = a.b
791
+ // ^ range
792
+ // ^^^ enclosing_range
793
+ // const b = a.b(41).f(42).g(43)
794
+ // ^ range
795
+ // ^^^^^^^^^^^^^ enclosing_range
796
+ // ```
797
+ //
798
+ // When both `typed_enclosing_range` and the deprecated `enclosing_range`
799
+ // field are set, `typed_enclosing_range` takes precedence.
800
+ oneof typed_enclosing_range {
801
+ // Enclosing range spanning a single line.
802
+ SingleLineRange single_line_enclosing_range = 10;
803
+ // Enclosing range spanning multiple lines.
804
+ MultiLineRange multi_line_enclosing_range = 11;
805
+ }
806
+ }
807
+
808
+ // Represents a diagnostic, such as a compiler error or warning, which should be
809
+ // reported for a document.
810
+ message Diagnostic {
811
+ // Should this diagnostic be reported as an error, warning, info, or hint?
812
+ Severity severity = 1;
813
+ // (optional) Code of this diagnostic, which might appear in the user interface.
814
+ string code = 2;
815
+ // Message of this diagnostic.
816
+ string message = 3;
817
+ // (optional) Human-readable string describing the source of this diagnostic, e.g.
818
+ // 'typescript' or 'super lint'.
819
+ string source = 4;
820
+ repeated DiagnosticTag tags = 5;
821
+ }
822
+
823
+ enum Severity {
824
+ UnspecifiedSeverity = 0;
825
+ Error = 1;
826
+ Warning = 2;
827
+ Information = 3;
828
+ Hint = 4;
829
+ }
830
+
831
+ enum DiagnosticTag {
832
+ UnspecifiedDiagnosticTag = 0;
833
+ Unnecessary = 1;
834
+ Deprecated = 2;
835
+ }
836
+
837
+ // Language standardises names of common programming languages that can be used
838
+ // for the `Document.language` field. The primary purpose of this enum is to
839
+ // prevent a situation where we have a single programming language ends up with
840
+ // multiple string representations. For example, the C++ language uses the name
841
+ // "CPP" in this enum and other names such as "cpp" are incompatible.
842
+ // Feel free to send a pull-request to add missing programming languages.
843
+ enum Language {
844
+ UnspecifiedLanguage = 0;
845
+ ABAP = 60;
846
+ Apex = 96;
847
+ APL = 49;
848
+ Ada = 39;
849
+ Agda = 45;
850
+ AsciiDoc = 86;
851
+ Assembly = 58;
852
+ Awk = 66;
853
+ Bat = 68;
854
+ BibTeX = 81;
855
+ C = 34;
856
+ COBOL = 59;
857
+ CPP = 35; // C++ (the name "CPP" was chosen for consistency with LSP)
858
+ CSS = 26;
859
+ CSharp = 1;
860
+ Clojure = 8;
861
+ Coffeescript = 21;
862
+ CommonLisp = 9;
863
+ Coq = 47;
864
+ CUDA = 97;
865
+ Dart = 3;
866
+ Delphi = 57;
867
+ Diff = 88;
868
+ Dockerfile = 80;
869
+ Dyalog = 50;
870
+ Elixir = 17;
871
+ Erlang = 18;
872
+ FSharp = 42;
873
+ Fish = 65;
874
+ Flow = 24;
875
+ Fortran = 56;
876
+ Git_Commit = 91;
877
+ Git_Config = 89;
878
+ Git_Rebase = 92;
879
+ Go = 33;
880
+ GraphQL = 98;
881
+ Groovy = 7;
882
+ HTML = 30;
883
+ Hack = 20;
884
+ Handlebars = 90;
885
+ Haskell = 44;
886
+ Idris = 46;
887
+ Ini = 72;
888
+ J = 51;
889
+ JSON = 75;
890
+ Java = 6;
891
+ JavaScript = 22;
892
+ JavaScriptReact = 93;
893
+ Jsonnet = 76;
894
+ Julia = 55;
895
+ Justfile = 109;
896
+ Kotlin = 4;
897
+ LaTeX = 83;
898
+ Lean = 48;
899
+ Less = 27;
900
+ Lua = 12;
901
+ Luau = 108;
902
+ Makefile = 79;
903
+ Markdown = 84;
904
+ Matlab = 52;
905
+ Nickel = 110; // https://nickel-lang.org/
906
+ Nix = 77;
907
+ OCaml = 41;
908
+ Objective_C = 36;
909
+ Objective_CPP = 37;
910
+ Odin = 111; // https://odin-lang.org/
911
+ Pascal = 99;
912
+ PHP = 19;
913
+ PLSQL = 70;
914
+ Perl = 13;
915
+ PowerShell = 67;
916
+ Prolog = 71;
917
+ Protobuf = 100;
918
+ Python = 15;
919
+ R = 54;
920
+ Racket = 11;
921
+ Raku = 14;
922
+ Razor = 62;
923
+ Repro = 102; // Internal language for testing SCIP
924
+ ReST = 85;
925
+ Ruby = 16;
926
+ Rust = 40;
927
+ SAS = 61;
928
+ SCSS = 29;
929
+ SML = 43;
930
+ SQL = 69;
931
+ Sass = 28;
932
+ Scala = 5;
933
+ Scheme = 10;
934
+ ShellScript = 64; // Bash
935
+ Skylark = 78;
936
+ Slang = 107;
937
+ Solidity = 95;
938
+ Svelte = 106;
939
+ Swift = 2;
940
+ Tcl = 101;
941
+ TOML = 73;
942
+ TeX = 82;
943
+ Thrift = 103;
944
+ TypeScript = 23;
945
+ TypeScriptReact = 94;
946
+ Verilog = 104;
947
+ VHDL = 105;
948
+ VisualBasic = 63;
949
+ Vue = 25;
950
+ Wolfram = 53;
951
+ XML = 31;
952
+ XSL = 32;
953
+ YAML = 74;
954
+ Zig = 38;
955
+ // NextLanguage = 112;
956
+ // Steps add a new language:
957
+ // 1. Copy-paste the "NextLanguage = N" line above
958
+ // 2. Increment "NextLanguage = N" to "NextLanguage = N+1"
959
+ // 3. Replace "NextLanguage = N" with the name of the new language.
960
+ // 4. Move the new language to the correct line above using alphabetical order
961
+ // 5. (optional) Add a brief comment behind the language if the name is not self-explanatory
962
+ }