MCPcopy Create free account
hub / github.com/ParzivalHack/PySpector / get_ast_json

Method get_ast_json

src/pyspector/ast_cache.py:275–285  ·  view source on GitHub ↗

Return the AST JSON string for *file_path*. Raises ------ SyntaxError If the file cannot be parsed, so callers can emit user-facing warnings while keeping cache logic out of the CLI layer.

(self, file_path: Path, content: str)

Source from the content-addressed store, hash-verified

273 # ── Public API ───────────────────────────────────────────────────────────
274
275 def get_ast_json(self, file_path: Path, content: str) -> str:
276 """
277 Return the AST JSON string for *file_path*.
278
279 Raises
280 ------
281 SyntaxError
282 If the file cannot be parsed, so callers can emit user-facing
283 warnings while keeping cache logic out of the CLI layer.
284 """
285 return zlib.decompress(self._get_entry(file_path, content).full_ast_json_z).decode()
286
287 def invalidate(self, file_path: Path) -> None:
288 """Remove all cached data for a single file."""

Calls 1

_get_entryMethod · 0.95