Uh oh!
There was an error while loading. Please reload this page.
feat(typescript): the four bulk/projected accessors — parity with Python's #180/#181 surface (#298) - #302
Merged
Merged
Conversation
tests/resources/typescript/analysis_json/slim/analysis.json was caught by the blanket *.json gitignore rule and never committed, even though the TS bulk accessor tests assert exact-set constants against it and it was hand-built from a src/external.ts that was itself never committed -- so a fresh clone could neither run the suite nor regenerate the fixture. Add a narrow .gitignore exception and track the file.
…298) get x()/set x() pairs share one TSCallable.signature, so the in-memory backend's last-writer-wins _callables map collapses the pair to a single row while the Neo4j backend (one node per accessor) surfaces two -- and duplicate decorator names diverge the same way via collect(DISTINCT ...). Invisible on the current sample-app fixture (unpaired getter only), but the live parity suite would catch it on any app with a real paired accessor. Filed as #300; note it on the ABC and facade get_callables_overview docstrings, and record that decorator order isn't part of the cross-backend contract.
…st, decorator-order note (#298) - test_overview_owner_pair_is_none_for_ownerless_callables: fix the "owned_less" typo and assert the ownerless signature set exactly, not just membership. - get_method_bodies / get_callsites_for: replace the O(all callables) walk via _iter_callables() with direct _callables.get(sig) lookups keyed on the requested signatures; omission/empty-entry semantics unchanged (covering tests stay green). - test_facade_delegates_to_backend: replace the same-fixture double-call (which only proved the fixture is deterministic) with a MagicMock-backed facade asserting each bulk accessor calls the identical backend method with the identical arguments and returns its exact object.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the 1.4-line half of #298 (the release/2.0 forward-port follows separately).
What this adds
The four set-at-a-time projected accessors on the TypeScript surface, mirroring Python's #180/#181 template — on both backends:
get_callables_overview() -> List[TSCallableOverview]— new projection model: parity core + TS facets (is_exported,is_async,is_static,accessibility), analyzer-native 7-valuekindpassthrough,owner_signature/owner_kindpair (closedclass|interfaceset; namespace-owned, nested, and module-level callables are ownerless — the dotted signature carries the namespace path)get_method_bodies(signatures)— mechanical omission rule: entries withcode=None(implicit constructors, synthesized callables) and unknown signatures are omitted; every returned value is a realstrget_decorated_callables(markers)/get_callsites_for(signatures)— verbatim Python contracts (empty-entry-vs-omitted semantics)Verification
--emit neo4j): all four accessors agree, full-field comparisons (113 passed)Filed during review
get_method_bodiestwin gap (align upward to the TS rule)get_method_bodies; the omission rule is mechanicalcode is NoneShips as 1.5.0 (additive API ⇒ minor). Remaining on #298 after merge: the release/2.0 forward-port (needs the upstream cants decorators-projection issue first — the 2.0-era emit dropped decorator projection).