Uh oh!
There was an error while loading. Please reload this page.
fix(typescript): module-level function fallback in get_method (local + Neo4j) - #251
Merged
Conversation
get_method only ever looked at _methods_by_class (local backend) / matched [:HAS_METHOD] (Neo4j backend), so module- and namespace-level functions -- the dominant callable kind in most TS code -- were unreachable through it, and get_method_parameters inherited the false-empty miss. Both backends now fall back to function resolution when the class lookup misses: an exact signature match first, then a short-name match scoped under the given class/module/namespace. The local backend resolves against _functions; the Neo4j backend runs a DECLARES-based fallback query mirroring get_all_functions. _resolve_signature's composed-guess fallback is untouched.
…arameter assertions (#247)
Merged
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#247.
What
The TypeScript backends'
get_methodwas class-scope only — module-level functions (the dominant callable kind in TS) were unreachable, andget_method_parametersinherited the miss. Fixed on both backends:_functions(exact signature first, then short-name scoped by prefix).DECLARES-based fallback query mirroringget_all_functions' pattern, including_module IN $modsapp scoping._resolve_signature's composed-guess fallback is deliberately untouched (miss discrimination is #249).Tests
New
tests/analysis/typescript/test_typescript_get_method_functions.py(16 tests): self-contained pydantic fixture + stubbed-_runNeo4j tests that exercise the real reconstruction path (_callable_full→R.callable_with realparameters_jsondecoding), plus backend-parity and genuine-miss pins. TDD RED→GREEN. Matching integration tests added to the two golden-fixture files.Gate on head
ec284c1:tests/analysis/typescript— 26 passed, 19 skipped, 23 errors; all 23 errors are the pre-existing missing golden fixture (tests/resources/typescript/analysis_json/slim/analysis.json), byte-identical on unmodified main; skips are Neo4j gating.Notes for reviewers
test_get_method_parameters_module_level_functionintegration tests assert the exact (empty) parameter list of the fixture's zero-argmain— smoke-grade only, since a miss also yields[]; the dedicated suite's parameterized-function assertions carry the discriminating load. Worth revisiting when the golden fixture is restored in CI.get_methodHAS_METHOD query lacks the_module IN $modsscoping its new fallback andget_all_functionshave — tracked in the #249 discussion.