Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
38e8420
Add design spec for getLibraryApi public-API extraction
knutwannheden Jun 12, 2026
8a4fcc8
Bump ruff submodule: widen dunder_all visibility for library API
knutwannheden Jun 12, 2026
9c10dfc
Add implementation plan for getLibraryApi
knutwannheden Jun 12, 2026
694a5d1
Add ty_python_core dep and library-API protocol types
knutwannheden Jun 12, 2026
5f8c62a
Add getLibraryApi: discover modules and public symbols
knutwannheden Jun 12, 2026
e933406
Test: getLibraryApi private-module, .pyi, and symbol-visibility filte…
knutwannheden Jun 12, 2026
af1568c
Emit classRef for classes defined outside the package boundary
knutwannheden Jun 12, 2026
e7191cf
Document getLibraryApi method and classRef descriptor
knutwannheden Jun 12, 2026
c590d50
Test cross-module boundary and __all__ re-export; document deliberate…
knutwannheden Jun 12, 2026
db23406
Generalize registry boundary to support module-set scoping
knutwannheden Jun 12, 2026
48b117a
Add getStdlibApi: stdlib discovery via all_modules with module-set bo…
knutwannheden Jun 12, 2026
cabccbe
Test stdlib multi-module + whole-dump; document getStdlibApi
knutwannheden Jun 12, 2026
5234989
Add implementation plan for getStdlibApi
knutwannheden Jun 12, 2026
bf44905
Apply optional first-party boundary to the getTypes session path
knutwannheden Jun 13, 2026
5db05d0
Simplify: extract parse_system_path helper, drop redundant clones
knutwannheden Jun 13, 2026
0c4d136
Apply cargo fmt to library/stdlib/boundary code and tests
knutwannheden Jun 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ echo '{"jsonrpc":"2.0","method":"initialize","params":{"projectRoot":"/path/to/p

JSON-RPC over stdin/stdout, one JSON object per line.

Methods: `initialize`, `getTypes`, `getTypeRegistry`, `shutdown`.
Methods: `initialize`, `getTypes`, `getTypeRegistry`, `getLibraryApi`, `getStdlibApi`, `shutdown`.

`getStdlibApi` extracts the standard library's public API for the project's configured Python version. Its `modules` param selects the local unit (top-level module names): classes in those modules are full `classLiteral`s, classes elsewhere become `classRef`. Omitting `modules` returns all stdlib modules fully expanded.

`initialize` accepts an optional first-party boundary that the session's `getTypes` registry honors: `firstPartyRoot` (a package root path) or `firstPartyModules` (top-level module names; used when `firstPartyRoot` is absent). When set, `getTypes` emits classes defined outside the boundary as `classRef` instead of fully expanding them; with neither field, every class is fully expanded (default behavior). `firstPartyRoot` takes precedence if both are given.

## TypeDescriptor Variants

Expand All @@ -48,6 +52,7 @@ Each type in the registry is represented as a `TypeDescriptor` with a `kind` dis
| `instance` | Instance of a class (`str`, `int`, `MyClass()`) | `className`, `moduleName`, `supertypes`, `typeArgs`, `classId` |
| `classLiteral` | Class object itself (`type[MyClass]`) | `className`, `moduleName`, `typeParameters`, `supertypes`, `members` |
| `subclassOf` | Subclass-of constraint | `base` |
| `classRef` | Reference to a class defined outside the extracted library boundary (identity only; maps to the type-table `TAG_CLASS_REF`) | `className`, `moduleName` |
| `typeForm` | `TypeForm[T]` value wrapping a type expression (PEP 747) | `typeArgument` |
| `union` | Union type (`X \| Y`) | `members` |
| `intersection` | Intersection type | `positive`, `negative` |
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ path = "src/main.rs"
ty_project = { path = "ruff/crates/ty_project", default-features = false }
ty_python_semantic = { path = "ruff/crates/ty_python_semantic" }
ty_module_resolver = { path = "ruff/crates/ty_module_resolver" }
ty_python_core = { path = "ruff/crates/ty_python_core" }
ty_static = { path = "ruff/crates/ty_static" }
ruff_db = { path = "ruff/crates/ruff_db", default-features = false, features = ["os"] }
ruff_python_ast = { path = "ruff/crates/ruff_python_ast" }
Expand Down
Loading