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)
| 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.""" |