descry-codegraph 0.1.0__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.
- descry/__init__.py +4 -0
- descry/_env.py +30 -0
- descry/_graph.py +36 -0
- descry/ast_grep.py +382 -0
- descry/cli.py +457 -0
- descry/cross_lang.py +404 -0
- descry/embeddings.py +593 -0
- descry/generate.py +3579 -0
- descry/git_history.py +1631 -0
- descry/handlers.py +1907 -0
- descry/mcp_server.py +355 -0
- descry/query.py +2345 -0
- descry/scip/__init__.py +0 -0
- descry/scip/cache.py +1047 -0
- descry/scip/parser.py +531 -0
- descry/scip/pb2.py +92 -0
- descry/scip/support.py +174 -0
- descry/tree_sitter_parser.py +356 -0
- descry/web/__init__.py +0 -0
- descry/web/server.py +1457 -0
- descry/web/web/index.html +2444 -0
- descry/web/web/style.css +1791 -0
- descry_codegraph-0.1.0.dist-info/METADATA +345 -0
- descry_codegraph-0.1.0.dist-info/RECORD +27 -0
- descry_codegraph-0.1.0.dist-info/WHEEL +4 -0
- descry_codegraph-0.1.0.dist-info/entry_points.txt +5 -0
- descry_codegraph-0.1.0.dist-info/licenses/LICENSE +21 -0
descry/scip/parser.py
ADDED
|
@@ -0,0 +1,531 @@
|
|
|
1
|
+
# /// script
|
|
2
|
+
# requires-python = ">=3.11"
|
|
3
|
+
# dependencies = [
|
|
4
|
+
# "protobuf>=4.0.0",
|
|
5
|
+
# ]
|
|
6
|
+
# ///
|
|
7
|
+
"""Parse SCIP index files and provide symbol resolution.
|
|
8
|
+
|
|
9
|
+
SCIP (Source Code Index Protocol) provides type-aware symbol information
|
|
10
|
+
from rust-analyzer that enables more accurate call resolution than
|
|
11
|
+
regex-based approaches.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import logging
|
|
17
|
+
import re
|
|
18
|
+
from pathlib import Path
|
|
19
|
+
from typing import TYPE_CHECKING
|
|
20
|
+
|
|
21
|
+
if TYPE_CHECKING:
|
|
22
|
+
from typing import Dict, List, Optional, Tuple
|
|
23
|
+
|
|
24
|
+
logger = logging.getLogger(__name__)
|
|
25
|
+
|
|
26
|
+
# Symbol role bitflags (from SCIP spec)
|
|
27
|
+
SYMBOL_ROLE_DEFINITION = 0x1
|
|
28
|
+
SYMBOL_ROLE_IMPORT = 0x2
|
|
29
|
+
SYMBOL_ROLE_WRITE_ACCESS = 0x4
|
|
30
|
+
SYMBOL_ROLE_READ_ACCESS = 0x8
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class ScipIndex:
|
|
34
|
+
"""Merged SCIP index for symbol resolution.
|
|
35
|
+
|
|
36
|
+
Loads multiple SCIP files and provides lookup capabilities for:
|
|
37
|
+
- Finding where symbols are defined
|
|
38
|
+
- Resolving references to their definitions
|
|
39
|
+
- Converting between SCIP symbol IDs and descry node IDs
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
def __init__(self, scip_files: List[Path]):
|
|
43
|
+
"""Initialize the index from SCIP files.
|
|
44
|
+
|
|
45
|
+
Args:
|
|
46
|
+
scip_files: List of paths to .scip files to load
|
|
47
|
+
"""
|
|
48
|
+
# symbol_id -> (file_path, line_number)
|
|
49
|
+
self.definitions: Dict[str, Tuple[str, int]] = {}
|
|
50
|
+
|
|
51
|
+
# (file_path, line) -> list of symbol_ids (may be multiple if several
|
|
52
|
+
# crates contribute the same relative file). At resolve time we prefer
|
|
53
|
+
# a candidate whose extracted name matches ref_name, then fall back to
|
|
54
|
+
# the first.
|
|
55
|
+
self.references: Dict[Tuple[str, int], List[str]] = {}
|
|
56
|
+
|
|
57
|
+
# symbol_id -> parsed symbol metadata
|
|
58
|
+
self.symbols: Dict[str, dict] = {}
|
|
59
|
+
|
|
60
|
+
# Simple name -> list of symbol_ids (for fuzzy matching)
|
|
61
|
+
self.name_to_symbols: Dict[str, List[str]] = {}
|
|
62
|
+
|
|
63
|
+
# Resolution statistics by language
|
|
64
|
+
self._resolution_stats: Dict[str, Dict[str, int]] = {
|
|
65
|
+
"rust": {"attempted": 0, "resolved": 0},
|
|
66
|
+
"typescript": {"attempted": 0, "resolved": 0},
|
|
67
|
+
"python": {"attempted": 0, "resolved": 0},
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
for scip_file in scip_files:
|
|
71
|
+
if scip_file.exists():
|
|
72
|
+
self._load_scip(scip_file)
|
|
73
|
+
|
|
74
|
+
logger.info(
|
|
75
|
+
f"SCIP: Loaded {len(self.definitions)} definitions, "
|
|
76
|
+
f"{len(self.references)} references from {len(scip_files)} files"
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
def _load_scip(self, scip_file: Path):
|
|
80
|
+
"""Load a SCIP index file.
|
|
81
|
+
|
|
82
|
+
Args:
|
|
83
|
+
scip_file: Path to the .scip file
|
|
84
|
+
"""
|
|
85
|
+
try:
|
|
86
|
+
# Import here to avoid import errors if protobuf not installed
|
|
87
|
+
from descry.scip import pb2 as scip_pb2
|
|
88
|
+
except ImportError:
|
|
89
|
+
try:
|
|
90
|
+
from descry.scip import pb2 as scip_pb2
|
|
91
|
+
except ImportError:
|
|
92
|
+
logger.warning("SCIP: protobuf bindings not available")
|
|
93
|
+
return
|
|
94
|
+
|
|
95
|
+
try:
|
|
96
|
+
index = scip_pb2.Index()
|
|
97
|
+
index.ParseFromString(scip_file.read_bytes())
|
|
98
|
+
except Exception as e:
|
|
99
|
+
logger.warning(f"SCIP: Failed to parse {scip_file}: {e}")
|
|
100
|
+
return
|
|
101
|
+
|
|
102
|
+
for doc in index.documents:
|
|
103
|
+
file_path = doc.relative_path
|
|
104
|
+
|
|
105
|
+
# Process occurrences (references and definitions)
|
|
106
|
+
for occ in doc.occurrences:
|
|
107
|
+
symbol_id = occ.symbol
|
|
108
|
+
if not symbol_id:
|
|
109
|
+
continue
|
|
110
|
+
|
|
111
|
+
# Extract line number from range (range is [startLine, startChar, ...])
|
|
112
|
+
line = occ.range[0] if occ.range else 0
|
|
113
|
+
|
|
114
|
+
# Check if this is a definition (symbol_roles & 0x1)
|
|
115
|
+
if occ.symbol_roles & SYMBOL_ROLE_DEFINITION:
|
|
116
|
+
self.definitions[symbol_id] = (file_path, line)
|
|
117
|
+
|
|
118
|
+
# Store all occurrences for reverse lookup. Append to a list
|
|
119
|
+
# so multi-crate workspaces that share relative filenames
|
|
120
|
+
# don't silently overwrite each other.
|
|
121
|
+
key = (file_path, line)
|
|
122
|
+
bucket = self.references.get(key)
|
|
123
|
+
if bucket is None:
|
|
124
|
+
self.references[key] = [symbol_id]
|
|
125
|
+
elif symbol_id not in bucket:
|
|
126
|
+
bucket.append(symbol_id)
|
|
127
|
+
|
|
128
|
+
# Process symbol information
|
|
129
|
+
for sym in doc.symbols:
|
|
130
|
+
self.symbols[sym.symbol] = {
|
|
131
|
+
"kind": sym.kind,
|
|
132
|
+
"display_name": sym.display_name,
|
|
133
|
+
"documentation": list(sym.documentation),
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
# Build name-to-symbol index for fuzzy matching
|
|
137
|
+
name = self._extract_name(sym.symbol)
|
|
138
|
+
if name:
|
|
139
|
+
if name not in self.name_to_symbols:
|
|
140
|
+
self.name_to_symbols[name] = []
|
|
141
|
+
self.name_to_symbols[name].append(sym.symbol)
|
|
142
|
+
|
|
143
|
+
def _extract_name(self, symbol_id: str) -> Optional[str]:
|
|
144
|
+
"""Extract the simple name from a SCIP symbol ID.
|
|
145
|
+
|
|
146
|
+
SCIP symbol format:
|
|
147
|
+
rust-analyzer cargo <crate> <version> <descriptors...>
|
|
148
|
+
scip-typescript npm <package> <version> <descriptors...>
|
|
149
|
+
|
|
150
|
+
Examples:
|
|
151
|
+
- "rust-analyzer cargo mydb 0.1.0 database/migrations/run_migrations()."
|
|
152
|
+
-> "run_migrations"
|
|
153
|
+
- "rust-analyzer cargo backend 0.1.0 state/AppState#new()."
|
|
154
|
+
-> "new"
|
|
155
|
+
- "scip-typescript npm webapp 0.1.0 src/lib/api/`client.ts`/getAuthToken()."
|
|
156
|
+
-> "getAuthToken"
|
|
157
|
+
|
|
158
|
+
Returns the last identifier (e.g., "run_migrations").
|
|
159
|
+
"""
|
|
160
|
+
if not symbol_id:
|
|
161
|
+
return None
|
|
162
|
+
|
|
163
|
+
# Local symbols have format "local <id>"
|
|
164
|
+
if symbol_id.startswith("local "):
|
|
165
|
+
return None
|
|
166
|
+
|
|
167
|
+
# Split on spaces to get parts
|
|
168
|
+
parts = symbol_id.split()
|
|
169
|
+
if len(parts) < 4:
|
|
170
|
+
return None
|
|
171
|
+
|
|
172
|
+
scheme = parts[0]
|
|
173
|
+
|
|
174
|
+
# The descriptors are after scheme, manager, package, version
|
|
175
|
+
# Example: ["rust-analyzer", "cargo", "mydb", "0.1.0", "database/migrations/run_migrations()."]
|
|
176
|
+
descriptors = " ".join(parts[4:]) if len(parts) > 4 else ""
|
|
177
|
+
if not descriptors:
|
|
178
|
+
return None
|
|
179
|
+
|
|
180
|
+
# Use language-specific parsing. scip-python uses the same
|
|
181
|
+
# backtick-wrapped file-path format as scip-typescript (the path
|
|
182
|
+
# before the last backtick is module info baked into the file_path
|
|
183
|
+
# we already track), so route it through the same extractor.
|
|
184
|
+
if scheme in ("scip-typescript", "scip-python"):
|
|
185
|
+
name_parts = self._parse_typescript_descriptors(descriptors)
|
|
186
|
+
else:
|
|
187
|
+
name_parts = self._parse_descriptors(descriptors)
|
|
188
|
+
|
|
189
|
+
return name_parts[-1] if name_parts else None
|
|
190
|
+
|
|
191
|
+
def resolve(self, ref_name: str, source_file: str, line: int) -> Optional[str]:
|
|
192
|
+
"""Resolve a reference to its definition node ID.
|
|
193
|
+
|
|
194
|
+
Attempts resolution in order:
|
|
195
|
+
1. Exact location lookup (file + line)
|
|
196
|
+
2. Try with package-relative path (for TypeScript: webapp/src/... -> src/...)
|
|
197
|
+
3. Symbol name matching
|
|
198
|
+
|
|
199
|
+
Args:
|
|
200
|
+
ref_name: The reference name to resolve (e.g., "validate_token")
|
|
201
|
+
source_file: Path to the file containing the reference
|
|
202
|
+
line: Line number of the reference
|
|
203
|
+
|
|
204
|
+
Returns:
|
|
205
|
+
Descry node ID if resolved, None otherwise
|
|
206
|
+
"""
|
|
207
|
+
# Determine language for statistics tracking
|
|
208
|
+
if source_file.endswith((".ts", ".tsx", ".js", ".jsx", ".svelte")):
|
|
209
|
+
lang = "typescript"
|
|
210
|
+
elif source_file.endswith(".py"):
|
|
211
|
+
lang = "python"
|
|
212
|
+
else:
|
|
213
|
+
lang = "rust"
|
|
214
|
+
if lang in self._resolution_stats:
|
|
215
|
+
self._resolution_stats[lang]["attempted"] += 1
|
|
216
|
+
|
|
217
|
+
# Strategy 1: Try exact location lookup with full path
|
|
218
|
+
candidates = self.references.get((source_file, line)) or []
|
|
219
|
+
|
|
220
|
+
# Strategy 1b: Try with package-relative path
|
|
221
|
+
# Descry uses: webapp/src/lib/stores/auth.ts
|
|
222
|
+
# SCIP indexes: src/lib/stores/auth.ts
|
|
223
|
+
if not candidates and "/" in source_file:
|
|
224
|
+
# Try stripping the first path component (package name)
|
|
225
|
+
parts = source_file.split("/", 1)
|
|
226
|
+
if len(parts) == 2:
|
|
227
|
+
relative_path = parts[1]
|
|
228
|
+
candidates = self.references.get((relative_path, line)) or []
|
|
229
|
+
|
|
230
|
+
if candidates:
|
|
231
|
+
# Prefer a candidate whose extracted name matches ref_name (helps
|
|
232
|
+
# disambiguate multi-crate overlaps where several crates contribute
|
|
233
|
+
# the same (file, line) tuple).
|
|
234
|
+
chosen = None
|
|
235
|
+
for cid in candidates:
|
|
236
|
+
if cid in self.definitions and self._extract_name(cid) == ref_name:
|
|
237
|
+
chosen = cid
|
|
238
|
+
break
|
|
239
|
+
if chosen is None:
|
|
240
|
+
for cid in candidates:
|
|
241
|
+
if cid in self.definitions:
|
|
242
|
+
chosen = cid
|
|
243
|
+
break
|
|
244
|
+
if chosen is not None:
|
|
245
|
+
def_file, def_line = self.definitions[chosen]
|
|
246
|
+
if lang in self._resolution_stats:
|
|
247
|
+
self._resolution_stats[lang]["resolved"] += 1
|
|
248
|
+
return self._to_node_id(chosen, def_file)
|
|
249
|
+
|
|
250
|
+
# Strategy 2: Try symbol name matching
|
|
251
|
+
result = self._fuzzy_resolve(ref_name)
|
|
252
|
+
if result and lang in self._resolution_stats:
|
|
253
|
+
self._resolution_stats[lang]["resolved"] += 1
|
|
254
|
+
return result
|
|
255
|
+
|
|
256
|
+
def _fuzzy_resolve(self, ref_name: str) -> Optional[str]:
|
|
257
|
+
"""Attempt fuzzy resolution by name.
|
|
258
|
+
|
|
259
|
+
Args:
|
|
260
|
+
ref_name: Reference name to look up
|
|
261
|
+
|
|
262
|
+
Returns:
|
|
263
|
+
Descry node ID if found, None otherwise
|
|
264
|
+
"""
|
|
265
|
+
# Extract simple name from qualified references
|
|
266
|
+
# e.g., "ThoraxServer::start" -> "start"
|
|
267
|
+
simple_name = ref_name.split("::")[-1].split(".")[-1]
|
|
268
|
+
|
|
269
|
+
if simple_name in self.name_to_symbols:
|
|
270
|
+
symbol_ids = self.name_to_symbols[simple_name]
|
|
271
|
+
# Prefer symbols that match more of the qualified name
|
|
272
|
+
if "::" in ref_name:
|
|
273
|
+
type_name = ref_name.split("::")[-2] if "::" in ref_name else ""
|
|
274
|
+
for sym_id in symbol_ids:
|
|
275
|
+
if type_name and type_name.lower() in sym_id.lower():
|
|
276
|
+
if sym_id in self.definitions:
|
|
277
|
+
def_file, _ = self.definitions[sym_id]
|
|
278
|
+
return self._to_node_id(sym_id, def_file)
|
|
279
|
+
|
|
280
|
+
# Fall back to first match
|
|
281
|
+
for sym_id in symbol_ids:
|
|
282
|
+
if sym_id in self.definitions:
|
|
283
|
+
def_file, _ = self.definitions[sym_id]
|
|
284
|
+
return self._to_node_id(sym_id, def_file)
|
|
285
|
+
|
|
286
|
+
return None
|
|
287
|
+
|
|
288
|
+
def _to_node_id(self, symbol_id: str, file_path: str) -> str:
|
|
289
|
+
"""Convert SCIP symbol to descry node ID.
|
|
290
|
+
|
|
291
|
+
SCIP symbol formats:
|
|
292
|
+
- Rust: "rust-analyzer cargo backend 0.1.0 state/AppState#new()."
|
|
293
|
+
- TypeScript: "scip-typescript npm webapp 0.1.0 src/lib/api/`client.ts`/getAuthToken()."
|
|
294
|
+
|
|
295
|
+
Descry node ID format:
|
|
296
|
+
"FILE:backend/src/state.rs::AppState::new"
|
|
297
|
+
|
|
298
|
+
The key transformations:
|
|
299
|
+
1. Prepend crate/package name to file path (src/state.rs -> backend/src/state.rs)
|
|
300
|
+
2. Extract only type/method names, not module paths
|
|
301
|
+
(state/AppState#new -> AppState::new)
|
|
302
|
+
|
|
303
|
+
Args:
|
|
304
|
+
symbol_id: SCIP symbol identifier
|
|
305
|
+
file_path: Path to the file where the symbol is defined
|
|
306
|
+
|
|
307
|
+
Returns:
|
|
308
|
+
Descry-style node ID
|
|
309
|
+
"""
|
|
310
|
+
parts = symbol_id.split()
|
|
311
|
+
if len(parts) < 4:
|
|
312
|
+
return f"FILE:{file_path}"
|
|
313
|
+
|
|
314
|
+
scheme = parts[0]
|
|
315
|
+
|
|
316
|
+
# Extract crate/package name (e.g., "backend", "mydb", "webapp")
|
|
317
|
+
package_name = parts[2]
|
|
318
|
+
|
|
319
|
+
# Build full file path with package prefix
|
|
320
|
+
# SCIP gives: src/state.rs, descry expects: backend/src/state.rs
|
|
321
|
+
if not file_path.startswith(package_name + "/"):
|
|
322
|
+
full_path = f"{package_name}/{file_path}"
|
|
323
|
+
else:
|
|
324
|
+
full_path = file_path
|
|
325
|
+
|
|
326
|
+
# Extract descriptors (everything after scheme, manager, package, version)
|
|
327
|
+
descriptors = " ".join(parts[4:]) if len(parts) > 4 else ""
|
|
328
|
+
|
|
329
|
+
# Parse descriptors using language-specific parser
|
|
330
|
+
if scheme == "scip-typescript":
|
|
331
|
+
name_parts = self._parse_typescript_descriptors(descriptors)
|
|
332
|
+
else:
|
|
333
|
+
name_parts = self._parse_descriptors(descriptors)
|
|
334
|
+
|
|
335
|
+
if name_parts:
|
|
336
|
+
return f"FILE:{full_path}::{'::'.join(name_parts)}"
|
|
337
|
+
return f"FILE:{full_path}"
|
|
338
|
+
|
|
339
|
+
def _parse_descriptors(self, descriptors: str) -> List[str]:
|
|
340
|
+
"""Parse SCIP descriptors into name components for descry node IDs.
|
|
341
|
+
|
|
342
|
+
SCIP descriptors use suffixes to indicate type:
|
|
343
|
+
- / for namespaces/modules (SKIP these - they're in file path)
|
|
344
|
+
- # for types (struct, enum, trait) (INCLUDE)
|
|
345
|
+
- . for terms (constants, statics) (INCLUDE)
|
|
346
|
+
- () for methods (INCLUDE)
|
|
347
|
+
- [] for type parameters (SKIP)
|
|
348
|
+
- [impl] for impl blocks (extract struct name)
|
|
349
|
+
|
|
350
|
+
Example:
|
|
351
|
+
- "state/AppState#new()." -> ["AppState", "new"]
|
|
352
|
+
- "database/migrations/run_migrations()." -> ["run_migrations"]
|
|
353
|
+
- "impl#[AppState]new()." -> ["AppState", "new"]
|
|
354
|
+
|
|
355
|
+
Args:
|
|
356
|
+
descriptors: Raw descriptor string from SCIP symbol
|
|
357
|
+
|
|
358
|
+
Returns:
|
|
359
|
+
List of name components (types and methods only)
|
|
360
|
+
"""
|
|
361
|
+
names = []
|
|
362
|
+
|
|
363
|
+
# Pattern to match descriptors with their suffixes
|
|
364
|
+
# Group 1: name, Group 2: suffix
|
|
365
|
+
pattern = r"([a-zA-Z_][a-zA-Z0-9_]*)(\([^)]*\)|[#./\[\]])?"
|
|
366
|
+
|
|
367
|
+
for match in re.finditer(pattern, descriptors):
|
|
368
|
+
name = match.group(1)
|
|
369
|
+
suffix = match.group(2) or ""
|
|
370
|
+
|
|
371
|
+
if not name:
|
|
372
|
+
continue
|
|
373
|
+
|
|
374
|
+
# Skip modules/namespaces (suffix /)
|
|
375
|
+
if suffix == "/":
|
|
376
|
+
continue
|
|
377
|
+
|
|
378
|
+
# Skip impl keyword but include the type name in brackets
|
|
379
|
+
if name == "impl":
|
|
380
|
+
continue
|
|
381
|
+
|
|
382
|
+
# Skip 'tests' module in test paths
|
|
383
|
+
if name == "tests" and suffix == "/":
|
|
384
|
+
continue
|
|
385
|
+
|
|
386
|
+
# Include types (#), terms (.), and methods (())
|
|
387
|
+
names.append(name)
|
|
388
|
+
|
|
389
|
+
return names
|
|
390
|
+
|
|
391
|
+
def _parse_typescript_descriptors(self, descriptors: str) -> List[str]:
|
|
392
|
+
"""Parse TypeScript SCIP descriptors into name components for descry node IDs.
|
|
393
|
+
|
|
394
|
+
TypeScript SCIP descriptors use backticks to wrap filenames:
|
|
395
|
+
- src/lib/api/`client.ts`/getAuthToken(). -> ["getAuthToken"]
|
|
396
|
+
- src/lib/stores/`users.ts`/UsersStore#fetchUsers(). -> ["UsersStore", "fetchUsers"]
|
|
397
|
+
- src/lib/`stores`/`auth.ts`/AuthStore#login(). -> ["AuthStore", "login"]
|
|
398
|
+
|
|
399
|
+
The key insight is that everything before and inside backtick segments
|
|
400
|
+
is file path information (which we already have from file_path), so we
|
|
401
|
+
need to extract the symbol path after the LAST backtick segment.
|
|
402
|
+
|
|
403
|
+
Suffix meanings (same as Rust):
|
|
404
|
+
- # for types (class, interface, type alias)
|
|
405
|
+
- . for terms/exports
|
|
406
|
+
- () for methods/functions
|
|
407
|
+
- [] for type parameters (SKIP)
|
|
408
|
+
|
|
409
|
+
Args:
|
|
410
|
+
descriptors: Raw descriptor string from SCIP symbol
|
|
411
|
+
|
|
412
|
+
Returns:
|
|
413
|
+
List of name components (types and methods only)
|
|
414
|
+
"""
|
|
415
|
+
names = []
|
|
416
|
+
|
|
417
|
+
# Find the last backtick segment to skip past file path components
|
|
418
|
+
# Pattern: `filename.ts` or `dirname`
|
|
419
|
+
last_backtick_end = -1
|
|
420
|
+
backtick_positions = []
|
|
421
|
+
i = 0
|
|
422
|
+
while i < len(descriptors):
|
|
423
|
+
if descriptors[i] == "`":
|
|
424
|
+
start = i
|
|
425
|
+
i += 1
|
|
426
|
+
# Find closing backtick
|
|
427
|
+
while i < len(descriptors) and descriptors[i] != "`":
|
|
428
|
+
i += 1
|
|
429
|
+
if i < len(descriptors):
|
|
430
|
+
backtick_positions.append((start, i))
|
|
431
|
+
last_backtick_end = i
|
|
432
|
+
i += 1
|
|
433
|
+
|
|
434
|
+
# Extract the symbol portion after the last backtick segment
|
|
435
|
+
if last_backtick_end >= 0 and last_backtick_end < len(descriptors) - 1:
|
|
436
|
+
symbol_portion = descriptors[last_backtick_end + 1 :]
|
|
437
|
+
else:
|
|
438
|
+
# No backticks found, use entire string (fallback)
|
|
439
|
+
symbol_portion = descriptors
|
|
440
|
+
|
|
441
|
+
# Strip leading path separator if present
|
|
442
|
+
symbol_portion = symbol_portion.lstrip("/")
|
|
443
|
+
|
|
444
|
+
# Pattern to match TypeScript symbol descriptors with their suffixes
|
|
445
|
+
# Handles: name#, name., name(), name[T]
|
|
446
|
+
# Group 1: name, Group 2: suffix
|
|
447
|
+
pattern = r"([a-zA-Z_$][a-zA-Z0-9_$]*)(\([^)]*\)|[#./\[\]])?"
|
|
448
|
+
|
|
449
|
+
for match in re.finditer(pattern, symbol_portion):
|
|
450
|
+
name = match.group(1)
|
|
451
|
+
suffix = match.group(2) or ""
|
|
452
|
+
|
|
453
|
+
if not name:
|
|
454
|
+
continue
|
|
455
|
+
|
|
456
|
+
# Skip path separators - these indicate nested paths, not symbol names
|
|
457
|
+
if suffix == "/":
|
|
458
|
+
continue
|
|
459
|
+
|
|
460
|
+
# Skip type parameters like [T] or [T, U]
|
|
461
|
+
if suffix.startswith("["):
|
|
462
|
+
continue
|
|
463
|
+
|
|
464
|
+
# Skip common TypeScript keywords that aren't real symbols
|
|
465
|
+
if name in (
|
|
466
|
+
"export",
|
|
467
|
+
"default",
|
|
468
|
+
"async",
|
|
469
|
+
"function",
|
|
470
|
+
"class",
|
|
471
|
+
"interface",
|
|
472
|
+
"type",
|
|
473
|
+
"const",
|
|
474
|
+
"let",
|
|
475
|
+
"var",
|
|
476
|
+
):
|
|
477
|
+
continue
|
|
478
|
+
|
|
479
|
+
# Include types (#), terms (.), and methods/functions (())
|
|
480
|
+
names.append(name)
|
|
481
|
+
|
|
482
|
+
return names
|
|
483
|
+
|
|
484
|
+
def get_definition_location(self, symbol_id: str) -> Optional[Tuple[str, int]]:
|
|
485
|
+
"""Get the definition location for a symbol.
|
|
486
|
+
|
|
487
|
+
Args:
|
|
488
|
+
symbol_id: SCIP symbol identifier
|
|
489
|
+
|
|
490
|
+
Returns:
|
|
491
|
+
Tuple of (file_path, line_number) or None if not found
|
|
492
|
+
"""
|
|
493
|
+
return self.definitions.get(symbol_id)
|
|
494
|
+
|
|
495
|
+
def get_symbol_info(self, symbol_id: str) -> Optional[dict]:
|
|
496
|
+
"""Get metadata for a symbol.
|
|
497
|
+
|
|
498
|
+
Args:
|
|
499
|
+
symbol_id: SCIP symbol identifier
|
|
500
|
+
|
|
501
|
+
Returns:
|
|
502
|
+
Dictionary with kind, display_name, documentation, or None
|
|
503
|
+
"""
|
|
504
|
+
return self.symbols.get(symbol_id)
|
|
505
|
+
|
|
506
|
+
def get_stats(self) -> dict:
|
|
507
|
+
"""Get statistics about the loaded index.
|
|
508
|
+
|
|
509
|
+
Returns:
|
|
510
|
+
Dictionary with counts of definitions, references, resolution rates, etc.
|
|
511
|
+
"""
|
|
512
|
+
# Calculate resolution rates by language
|
|
513
|
+
resolution_rates = {}
|
|
514
|
+
for lang, stats in self._resolution_stats.items():
|
|
515
|
+
attempted = stats["attempted"]
|
|
516
|
+
resolved = stats["resolved"]
|
|
517
|
+
if attempted > 0:
|
|
518
|
+
rate = 100 * resolved / attempted
|
|
519
|
+
resolution_rates[lang] = {
|
|
520
|
+
"attempted": attempted,
|
|
521
|
+
"resolved": resolved,
|
|
522
|
+
"rate_percent": round(rate, 1),
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
return {
|
|
526
|
+
"definitions": len(self.definitions),
|
|
527
|
+
"references": len(self.references),
|
|
528
|
+
"symbols": len(self.symbols),
|
|
529
|
+
"unique_names": len(self.name_to_symbols),
|
|
530
|
+
"resolution_by_language": resolution_rates,
|
|
531
|
+
}
|
descry/scip/pb2.py
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: scip.proto
|
|
5
|
+
# Protobuf Python Version: 6.33.4
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
|
|
8
|
+
from google.protobuf import descriptor as _descriptor
|
|
9
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
10
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
11
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
12
|
+
from google.protobuf.internal import builder as _builder
|
|
13
|
+
|
|
14
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
15
|
+
_runtime_version.Domain.PUBLIC, 6, 33, 4, "", "scip.proto"
|
|
16
|
+
)
|
|
17
|
+
# @@protoc_insertion_point(imports)
|
|
18
|
+
|
|
19
|
+
_sym_db = _symbol_database.Default()
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
|
|
23
|
+
b'\n\nscip.proto\x12\x04scip"\x7f\n\x05Index\x12 \n\x08metadata\x18\x01 \x01(\x0b\x32\x0e.scip.Metadata\x12!\n\tdocuments\x18\x02 \x03(\x0b\x32\x0e.scip.Document\x12\x31\n\x10\x65xternal_symbols\x18\x03 \x03(\x0b\x32\x17.scip.SymbolInformation"\x9f\x01\n\x08Metadata\x12&\n\x07version\x18\x01 \x01(\x0e\x32\x15.scip.ProtocolVersion\x12!\n\ttool_info\x18\x02 \x01(\x0b\x32\x0e.scip.ToolInfo\x12\x14\n\x0cproject_root\x18\x03 \x01(\t\x12\x32\n\x16text_document_encoding\x18\x04 \x01(\x0e\x32\x12.scip.TextEncoding"<\n\x08ToolInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x11\n\targuments\x18\x03 \x03(\t"\xc5\x01\n\x08\x44ocument\x12\x10\n\x08language\x18\x04 \x01(\t\x12\x15\n\rrelative_path\x18\x01 \x01(\t\x12%\n\x0boccurrences\x18\x02 \x03(\x0b\x32\x10.scip.Occurrence\x12(\n\x07symbols\x18\x03 \x03(\x0b\x32\x17.scip.SymbolInformation\x12\x0c\n\x04text\x18\x05 \x01(\t\x12\x31\n\x11position_encoding\x18\x06 \x01(\x0e\x32\x16.scip.PositionEncoding"_\n\x06Symbol\x12\x0e\n\x06scheme\x18\x01 \x01(\t\x12\x1e\n\x07package\x18\x02 \x01(\x0b\x32\r.scip.Package\x12%\n\x0b\x64\x65scriptors\x18\x03 \x03(\x0b\x32\x10.scip.Descriptor"9\n\x07Package\x12\x0f\n\x07manager\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t"\x82\x02\n\nDescriptor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x15\n\rdisambiguator\x18\x02 \x01(\t\x12\'\n\x06suffix\x18\x03 \x01(\x0e\x32\x17.scip.Descriptor.Suffix"\xa5\x01\n\x06Suffix\x12\x15\n\x11UnspecifiedSuffix\x10\x00\x12\r\n\tNamespace\x10\x01\x12\x0f\n\x07Package\x10\x01\x1a\x02\x08\x01\x12\x08\n\x04Type\x10\x02\x12\x08\n\x04Term\x10\x03\x12\n\n\x06Method\x10\x04\x12\x11\n\rTypeParameter\x10\x05\x12\r\n\tParameter\x10\x06\x12\x08\n\x04Meta\x10\x07\x12\t\n\x05Local\x10\x08\x12\t\n\x05Macro\x10\t\x1a\x02\x10\x01"\xf0\x0b\n\x11SymbolInformation\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x15\n\rdocumentation\x18\x03 \x03(\t\x12)\n\rrelationships\x18\x04 \x03(\x0b\x32\x12.scip.Relationship\x12*\n\x04kind\x18\x05 \x01(\x0e\x32\x1c.scip.SymbolInformation.Kind\x12\x14\n\x0c\x64isplay_name\x18\x06 \x01(\t\x12/\n\x17signature_documentation\x18\x07 \x01(\x0b\x32\x0e.scip.Document\x12\x18\n\x10\x65nclosing_symbol\x18\x08 \x01(\t"\xfb\t\n\x04Kind\x12\x13\n\x0fUnspecifiedKind\x10\x00\x12\x12\n\x0e\x41\x62stractMethod\x10\x42\x12\x0c\n\x08\x41\x63\x63\x65ssor\x10H\x12\t\n\x05\x41rray\x10\x01\x12\r\n\tAssertion\x10\x02\x12\x12\n\x0e\x41ssociatedType\x10\x03\x12\r\n\tAttribute\x10\x04\x12\t\n\x05\x41xiom\x10\x05\x12\x0b\n\x07\x42oolean\x10\x06\x12\t\n\x05\x43lass\x10\x07\x12\x0b\n\x07\x43oncept\x10V\x12\x0c\n\x08\x43onstant\x10\x08\x12\x0f\n\x0b\x43onstructor\x10\t\x12\x0c\n\x08\x43ontract\x10>\x12\x0e\n\nDataFamily\x10\n\x12\x0c\n\x08\x44\x65legate\x10I\x12\x08\n\x04\x45num\x10\x0b\x12\x0e\n\nEnumMember\x10\x0c\x12\t\n\x05\x45rror\x10?\x12\t\n\x05\x45vent\x10\r\x12\r\n\tExtension\x10T\x12\x08\n\x04\x46\x61\x63t\x10\x0e\x12\t\n\x05\x46ield\x10\x0f\x12\x08\n\x04\x46ile\x10\x10\x12\x0c\n\x08\x46unction\x10\x11\x12\n\n\x06Getter\x10\x12\x12\x0b\n\x07Grammar\x10\x13\x12\x0c\n\x08Instance\x10\x14\x12\r\n\tInterface\x10\x15\x12\x07\n\x03Key\x10\x16\x12\x08\n\x04Lang\x10\x17\x12\t\n\x05Lemma\x10\x18\x12\x0b\n\x07Library\x10@\x12\t\n\x05Macro\x10\x19\x12\n\n\x06Method\x10\x1a\x12\x0f\n\x0bMethodAlias\x10J\x12\x12\n\x0eMethodReceiver\x10\x1b\x12\x17\n\x13MethodSpecification\x10\x43\x12\x0b\n\x07Message\x10\x1c\x12\t\n\x05Mixin\x10U\x12\x0c\n\x08Modifier\x10\x41\x12\n\n\x06Module\x10\x1d\x12\r\n\tNamespace\x10\x1e\x12\x08\n\x04Null\x10\x1f\x12\n\n\x06Number\x10 \x12\n\n\x06Object\x10!\x12\x0c\n\x08Operator\x10"\x12\x0b\n\x07Package\x10#\x12\x11\n\rPackageObject\x10$\x12\r\n\tParameter\x10%\x12\x12\n\x0eParameterLabel\x10&\x12\x0b\n\x07Pattern\x10\'\x12\r\n\tPredicate\x10(\x12\x0c\n\x08Property\x10)\x12\x0c\n\x08Protocol\x10*\x12\x12\n\x0eProtocolMethod\x10\x44\x12\x15\n\x11PureVirtualMethod\x10\x45\x12\x0f\n\x0bQuasiquoter\x10+\x12\x11\n\rSelfParameter\x10,\x12\n\n\x06Setter\x10-\x12\r\n\tSignature\x10.\x12\x12\n\x0eSingletonClass\x10K\x12\x13\n\x0fSingletonMethod\x10L\x12\x14\n\x10StaticDataMember\x10M\x12\x0f\n\x0bStaticEvent\x10N\x12\x0f\n\x0bStaticField\x10O\x12\x10\n\x0cStaticMethod\x10P\x12\x12\n\x0eStaticProperty\x10Q\x12\x12\n\x0eStaticVariable\x10R\x12\n\n\x06String\x10\x30\x12\n\n\x06Struct\x10\x31\x12\r\n\tSubscript\x10/\x12\n\n\x06Tactic\x10\x32\x12\x0b\n\x07Theorem\x10\x33\x12\x11\n\rThisParameter\x10\x34\x12\t\n\x05Trait\x10\x35\x12\x0f\n\x0bTraitMethod\x10\x46\x12\x08\n\x04Type\x10\x36\x12\r\n\tTypeAlias\x10\x37\x12\r\n\tTypeClass\x10\x38\x12\x13\n\x0fTypeClassMethod\x10G\x12\x0e\n\nTypeFamily\x10\x39\x12\x11\n\rTypeParameter\x10:\x12\t\n\x05Union\x10;\x12\t\n\x05Value\x10<\x12\x0c\n\x08Variable\x10="\x82\x01\n\x0cRelationship\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x14\n\x0cis_reference\x18\x02 \x01(\x08\x12\x19\n\x11is_implementation\x18\x03 \x01(\x08\x12\x1a\n\x12is_type_definition\x18\x04 \x01(\x08\x12\x15\n\ris_definition\x18\x05 \x01(\x08"\xc8\x01\n\nOccurrence\x12\r\n\x05range\x18\x01 \x03(\x05\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\x14\n\x0csymbol_roles\x18\x03 \x01(\x05\x12\x1e\n\x16override_documentation\x18\x04 \x03(\t\x12%\n\x0bsyntax_kind\x18\x05 \x01(\x0e\x32\x10.scip.SyntaxKind\x12%\n\x0b\x64iagnostics\x18\x06 \x03(\x0b\x32\x10.scip.Diagnostic\x12\x17\n\x0f\x65nclosing_range\x18\x07 \x03(\x05"\x80\x01\n\nDiagnostic\x12 \n\x08severity\x18\x01 \x01(\x0e\x32\x0e.scip.Severity\x12\x0c\n\x04\x63ode\x18\x02 \x01(\t\x12\x0f\n\x07message\x18\x03 \x01(\t\x12\x0e\n\x06source\x18\x04 \x01(\t\x12!\n\x04tags\x18\x05 \x03(\x0e\x32\x13.scip.DiagnosticTag*1\n\x0fProtocolVersion\x12\x1e\n\x1aUnspecifiedProtocolVersion\x10\x00*@\n\x0cTextEncoding\x12\x1b\n\x17UnspecifiedTextEncoding\x10\x00\x12\x08\n\x04UTF8\x10\x01\x12\t\n\x05UTF16\x10\x02*\xa4\x01\n\x10PositionEncoding\x12\x1f\n\x1bUnspecifiedPositionEncoding\x10\x00\x12#\n\x1fUTF8CodeUnitOffsetFromLineStart\x10\x01\x12$\n UTF16CodeUnitOffsetFromLineStart\x10\x02\x12$\n UTF32CodeUnitOffsetFromLineStart\x10\x03*\x94\x01\n\nSymbolRole\x12\x19\n\x15UnspecifiedSymbolRole\x10\x00\x12\x0e\n\nDefinition\x10\x01\x12\n\n\x06Import\x10\x02\x12\x0f\n\x0bWriteAccess\x10\x04\x12\x0e\n\nReadAccess\x10\x08\x12\r\n\tGenerated\x10\x10\x12\x08\n\x04Test\x10 \x12\x15\n\x11\x46orwardDefinition\x10@*\xea\x06\n\nSyntaxKind\x12\x19\n\x15UnspecifiedSyntaxKind\x10\x00\x12\x0b\n\x07\x43omment\x10\x01\x12\x18\n\x14PunctuationDelimiter\x10\x02\x12\x16\n\x12PunctuationBracket\x10\x03\x12\x0b\n\x07Keyword\x10\x04\x12\x19\n\x11IdentifierKeyword\x10\x04\x1a\x02\x08\x01\x12\x16\n\x12IdentifierOperator\x10\x05\x12\x0e\n\nIdentifier\x10\x06\x12\x15\n\x11IdentifierBuiltin\x10\x07\x12\x12\n\x0eIdentifierNull\x10\x08\x12\x16\n\x12IdentifierConstant\x10\t\x12\x1b\n\x17IdentifierMutableGlobal\x10\n\x12\x17\n\x13IdentifierParameter\x10\x0b\x12\x13\n\x0fIdentifierLocal\x10\x0c\x12\x16\n\x12IdentifierShadowed\x10\r\x12\x17\n\x13IdentifierNamespace\x10\x0e\x12\x18\n\x10IdentifierModule\x10\x0e\x1a\x02\x08\x01\x12\x16\n\x12IdentifierFunction\x10\x0f\x12 \n\x1cIdentifierFunctionDefinition\x10\x10\x12\x13\n\x0fIdentifierMacro\x10\x11\x12\x1d\n\x19IdentifierMacroDefinition\x10\x12\x12\x12\n\x0eIdentifierType\x10\x13\x12\x19\n\x15IdentifierBuiltinType\x10\x14\x12\x17\n\x13IdentifierAttribute\x10\x15\x12\x0f\n\x0bRegexEscape\x10\x16\x12\x11\n\rRegexRepeated\x10\x17\x12\x11\n\rRegexWildcard\x10\x18\x12\x12\n\x0eRegexDelimiter\x10\x19\x12\r\n\tRegexJoin\x10\x1a\x12\x11\n\rStringLiteral\x10\x1b\x12\x17\n\x13StringLiteralEscape\x10\x1c\x12\x18\n\x14StringLiteralSpecial\x10\x1d\x12\x14\n\x10StringLiteralKey\x10\x1e\x12\x14\n\x10\x43haracterLiteral\x10\x1f\x12\x12\n\x0eNumericLiteral\x10 \x12\x12\n\x0e\x42ooleanLiteral\x10!\x12\x07\n\x03Tag\x10"\x12\x10\n\x0cTagAttribute\x10#\x12\x10\n\x0cTagDelimiter\x10$\x1a\x02\x10\x01*V\n\x08Severity\x12\x17\n\x13UnspecifiedSeverity\x10\x00\x12\t\n\x05\x45rror\x10\x01\x12\x0b\n\x07Warning\x10\x02\x12\x0f\n\x0bInformation\x10\x03\x12\x08\n\x04Hint\x10\x04*N\n\rDiagnosticTag\x12\x1c\n\x18UnspecifiedDiagnosticTag\x10\x00\x12\x0f\n\x0bUnnecessary\x10\x01\x12\x0e\n\nDeprecated\x10\x02*\x9b\n\n\x08Language\x12\x17\n\x13UnspecifiedLanguage\x10\x00\x12\x08\n\x04\x41\x42\x41P\x10<\x12\x08\n\x04\x41pex\x10`\x12\x07\n\x03\x41PL\x10\x31\x12\x07\n\x03\x41\x64\x61\x10\'\x12\x08\n\x04\x41gda\x10-\x12\x0c\n\x08\x41sciiDoc\x10V\x12\x0c\n\x08\x41ssembly\x10:\x12\x07\n\x03\x41wk\x10\x42\x12\x07\n\x03\x42\x61t\x10\x44\x12\n\n\x06\x42ibTeX\x10Q\x12\x05\n\x01\x43\x10"\x12\t\n\x05\x43OBOL\x10;\x12\x07\n\x03\x43PP\x10#\x12\x07\n\x03\x43SS\x10\x1a\x12\n\n\x06\x43Sharp\x10\x01\x12\x0b\n\x07\x43lojure\x10\x08\x12\x10\n\x0c\x43offeescript\x10\x15\x12\x0e\n\nCommonLisp\x10\t\x12\x07\n\x03\x43oq\x10/\x12\x08\n\x04\x43UDA\x10\x61\x12\x08\n\x04\x44\x61rt\x10\x03\x12\n\n\x06\x44\x65lphi\x10\x39\x12\x08\n\x04\x44iff\x10X\x12\x0e\n\nDockerfile\x10P\x12\n\n\x06\x44yalog\x10\x32\x12\n\n\x06\x45lixir\x10\x11\x12\n\n\x06\x45rlang\x10\x12\x12\n\n\x06\x46Sharp\x10*\x12\x08\n\x04\x46ish\x10\x41\x12\x08\n\x04\x46low\x10\x18\x12\x0b\n\x07\x46ortran\x10\x38\x12\x0e\n\nGit_Commit\x10[\x12\x0e\n\nGit_Config\x10Y\x12\x0e\n\nGit_Rebase\x10\\\x12\x06\n\x02Go\x10!\x12\x0b\n\x07GraphQL\x10\x62\x12\n\n\x06Groovy\x10\x07\x12\x08\n\x04HTML\x10\x1e\x12\x08\n\x04Hack\x10\x14\x12\x0e\n\nHandlebars\x10Z\x12\x0b\n\x07Haskell\x10,\x12\t\n\x05Idris\x10.\x12\x07\n\x03Ini\x10H\x12\x05\n\x01J\x10\x33\x12\x08\n\x04JSON\x10K\x12\x08\n\x04Java\x10\x06\x12\x0e\n\nJavaScript\x10\x16\x12\x13\n\x0fJavaScriptReact\x10]\x12\x0b\n\x07Jsonnet\x10L\x12\t\n\x05Julia\x10\x37\x12\x0c\n\x08Justfile\x10m\x12\n\n\x06Kotlin\x10\x04\x12\t\n\x05LaTeX\x10S\x12\x08\n\x04Lean\x10\x30\x12\x08\n\x04Less\x10\x1b\x12\x07\n\x03Lua\x10\x0c\x12\x08\n\x04Luau\x10l\x12\x0c\n\x08Makefile\x10O\x12\x0c\n\x08Markdown\x10T\x12\n\n\x06Matlab\x10\x34\x12\n\n\x06Nickel\x10n\x12\x07\n\x03Nix\x10M\x12\t\n\x05OCaml\x10)\x12\x0f\n\x0bObjective_C\x10$\x12\x11\n\rObjective_CPP\x10%\x12\n\n\x06Pascal\x10\x63\x12\x07\n\x03PHP\x10\x13\x12\t\n\x05PLSQL\x10\x46\x12\x08\n\x04Perl\x10\r\x12\x0e\n\nPowerShell\x10\x43\x12\n\n\x06Prolog\x10G\x12\x0c\n\x08Protobuf\x10\x64\x12\n\n\x06Python\x10\x0f\x12\x05\n\x01R\x10\x36\x12\n\n\x06Racket\x10\x0b\x12\x08\n\x04Raku\x10\x0e\x12\t\n\x05Razor\x10>\x12\t\n\x05Repro\x10\x66\x12\x08\n\x04ReST\x10U\x12\x08\n\x04Ruby\x10\x10\x12\x08\n\x04Rust\x10(\x12\x07\n\x03SAS\x10=\x12\x08\n\x04SCSS\x10\x1d\x12\x07\n\x03SML\x10+\x12\x07\n\x03SQL\x10\x45\x12\x08\n\x04Sass\x10\x1c\x12\t\n\x05Scala\x10\x05\x12\n\n\x06Scheme\x10\n\x12\x0f\n\x0bShellScript\x10@\x12\x0b\n\x07Skylark\x10N\x12\t\n\x05Slang\x10k\x12\x0c\n\x08Solidity\x10_\x12\n\n\x06Svelte\x10j\x12\t\n\x05Swift\x10\x02\x12\x07\n\x03Tcl\x10\x65\x12\x08\n\x04TOML\x10I\x12\x07\n\x03TeX\x10R\x12\n\n\x06Thrift\x10g\x12\x0e\n\nTypeScript\x10\x17\x12\x13\n\x0fTypeScriptReact\x10^\x12\x0b\n\x07Verilog\x10h\x12\x08\n\x04VHDL\x10i\x12\x0f\n\x0bVisualBasic\x10?\x12\x07\n\x03Vue\x10\x19\x12\x0b\n\x07Wolfram\x10\x35\x12\x07\n\x03XML\x10\x1f\x12\x07\n\x03XSL\x10 \x12\x08\n\x04YAML\x10J\x12\x07\n\x03Zig\x10&B/Z-github.com/sourcegraph/scip/bindings/go/scip/b\x06proto3'
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
_globals = globals()
|
|
27
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
28
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "scip_pb2", _globals)
|
|
29
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
30
|
+
_globals["DESCRIPTOR"]._loaded_options = None
|
|
31
|
+
_globals[
|
|
32
|
+
"DESCRIPTOR"
|
|
33
|
+
]._serialized_options = b"Z-github.com/sourcegraph/scip/bindings/go/scip/"
|
|
34
|
+
_globals["_SYNTAXKIND"]._loaded_options = None
|
|
35
|
+
_globals["_SYNTAXKIND"]._serialized_options = b"\020\001"
|
|
36
|
+
_globals["_SYNTAXKIND"].values_by_name["IdentifierKeyword"]._loaded_options = None
|
|
37
|
+
_globals["_SYNTAXKIND"].values_by_name[
|
|
38
|
+
"IdentifierKeyword"
|
|
39
|
+
]._serialized_options = b"\010\001"
|
|
40
|
+
_globals["_SYNTAXKIND"].values_by_name["IdentifierModule"]._loaded_options = None
|
|
41
|
+
_globals["_SYNTAXKIND"].values_by_name[
|
|
42
|
+
"IdentifierModule"
|
|
43
|
+
]._serialized_options = b"\010\001"
|
|
44
|
+
_globals["_DESCRIPTOR_SUFFIX"]._loaded_options = None
|
|
45
|
+
_globals["_DESCRIPTOR_SUFFIX"]._serialized_options = b"\020\001"
|
|
46
|
+
_globals["_DESCRIPTOR_SUFFIX"].values_by_name["Package"]._loaded_options = None
|
|
47
|
+
_globals["_DESCRIPTOR_SUFFIX"].values_by_name[
|
|
48
|
+
"Package"
|
|
49
|
+
]._serialized_options = b"\010\001"
|
|
50
|
+
_globals["_PROTOCOLVERSION"]._serialized_start = 2980
|
|
51
|
+
_globals["_PROTOCOLVERSION"]._serialized_end = 3029
|
|
52
|
+
_globals["_TEXTENCODING"]._serialized_start = 3031
|
|
53
|
+
_globals["_TEXTENCODING"]._serialized_end = 3095
|
|
54
|
+
_globals["_POSITIONENCODING"]._serialized_start = 3098
|
|
55
|
+
_globals["_POSITIONENCODING"]._serialized_end = 3262
|
|
56
|
+
_globals["_SYMBOLROLE"]._serialized_start = 3265
|
|
57
|
+
_globals["_SYMBOLROLE"]._serialized_end = 3413
|
|
58
|
+
_globals["_SYNTAXKIND"]._serialized_start = 3416
|
|
59
|
+
_globals["_SYNTAXKIND"]._serialized_end = 4290
|
|
60
|
+
_globals["_SEVERITY"]._serialized_start = 4292
|
|
61
|
+
_globals["_SEVERITY"]._serialized_end = 4378
|
|
62
|
+
_globals["_DIAGNOSTICTAG"]._serialized_start = 4380
|
|
63
|
+
_globals["_DIAGNOSTICTAG"]._serialized_end = 4458
|
|
64
|
+
_globals["_LANGUAGE"]._serialized_start = 4461
|
|
65
|
+
_globals["_LANGUAGE"]._serialized_end = 5768
|
|
66
|
+
_globals["_INDEX"]._serialized_start = 20
|
|
67
|
+
_globals["_INDEX"]._serialized_end = 147
|
|
68
|
+
_globals["_METADATA"]._serialized_start = 150
|
|
69
|
+
_globals["_METADATA"]._serialized_end = 309
|
|
70
|
+
_globals["_TOOLINFO"]._serialized_start = 311
|
|
71
|
+
_globals["_TOOLINFO"]._serialized_end = 371
|
|
72
|
+
_globals["_DOCUMENT"]._serialized_start = 374
|
|
73
|
+
_globals["_DOCUMENT"]._serialized_end = 571
|
|
74
|
+
_globals["_SYMBOL"]._serialized_start = 573
|
|
75
|
+
_globals["_SYMBOL"]._serialized_end = 668
|
|
76
|
+
_globals["_PACKAGE"]._serialized_start = 670
|
|
77
|
+
_globals["_PACKAGE"]._serialized_end = 727
|
|
78
|
+
_globals["_DESCRIPTOR"]._serialized_start = 730
|
|
79
|
+
_globals["_DESCRIPTOR"]._serialized_end = 988
|
|
80
|
+
_globals["_DESCRIPTOR_SUFFIX"]._serialized_start = 823
|
|
81
|
+
_globals["_DESCRIPTOR_SUFFIX"]._serialized_end = 988
|
|
82
|
+
_globals["_SYMBOLINFORMATION"]._serialized_start = 991
|
|
83
|
+
_globals["_SYMBOLINFORMATION"]._serialized_end = 2511
|
|
84
|
+
_globals["_SYMBOLINFORMATION_KIND"]._serialized_start = 1236
|
|
85
|
+
_globals["_SYMBOLINFORMATION_KIND"]._serialized_end = 2511
|
|
86
|
+
_globals["_RELATIONSHIP"]._serialized_start = 2514
|
|
87
|
+
_globals["_RELATIONSHIP"]._serialized_end = 2644
|
|
88
|
+
_globals["_OCCURRENCE"]._serialized_start = 2647
|
|
89
|
+
_globals["_OCCURRENCE"]._serialized_end = 2847
|
|
90
|
+
_globals["_DIAGNOSTIC"]._serialized_start = 2850
|
|
91
|
+
_globals["_DIAGNOSTIC"]._serialized_end = 2978
|
|
92
|
+
# @@protoc_insertion_point(module_scope)
|