fix: close remaining Dart language support gaps#524
Conversation
Four issues that were not addressed in PR abhigyanpatwari#204: 1. extractFunctionName: add function_signature/method_signature handlers and add both to FUNCTION_NODE_TYPES. Without this, findEnclosingFunctionId cannot resolve Dart function scopes — all calls inside Dart functions have no sourceId, breaking CALLS edge attribution. 2. formal_parameter_list: add to paramListTypes in extractMethodSignature. Dart's tree-sitter grammar uses this node type (not formal_parameters), so parameter counting returns 0 for all Dart functions. 3. Write-access queries: add @assignment patterns for obj.field = value and this.field = value. Without these, no ACCESSES write edges are emitted for Dart code. 4. initialized_identifier guard in extractDartDeclaration: comma-separated declarations (String a, b, c) produce initialized_identifier nodes which are in DART_DECLARATION_NODE_TYPES but were unhandled — the type lives on the parent node. Also adds Dart column to the feature matrix in type-resolution-system.md. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@xFlaviews is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
|
I'll post my findings and we can fix them here. You nicely identified some gaps already! Thank you |
Dart Integration Tests & Pipeline FixesAdded integration tests for Dart field-type resolution and call-result binding, along with five pipeline fixes to make them pass. What's fixed
Test results
Files changed
|
…, and integration tests Fixes five Dart language support gaps with integration tests and architectural alignment: **Tree-sitter queries** — Add field declaration patterns for typed and nullable class fields (`String name = ''`, `String? name`). Without these, Dart class fields were invisible to the pipeline (zero Property nodes, zero HAS_PROPERTY edges). **Import resolution** — Dart relative imports (`import 'models.dart'`) don't use a leading `./`. The standard resolver only recognises paths starting with `.` as relative; bare paths fell through to a Java-style dot-to-slash conversion that mangled `models.dart` into `models/dart`. Fix: prepend `./` before calling resolveStandard. **Call attribution** — Dart's tree-sitter grammar places `function_body` as a sibling of `function_signature`, not as a child wrapping both. The `findEnclosingFunction` parent-walk never found the function because the call lives inside `function_body` which is a sibling of the signature. Fix: add `enclosingFunctionFinder` hook to LanguageProvider interface (following the same strategy pattern as `labelOverride`), with the Dart-specific logic in `languages/dart.ts`. Both `parse-worker.ts` and `call-processor.ts` consume the hook generically — no Dart-specific code in the generic processors. **Receiver chain extraction** — Add `unconditional_assignable_selector` to `MEMBER_ACCESS_NODE_TYPES` so `inferCallForm` returns `'member'` for Dart method calls. Add Dart-specific receiver extraction blocks in `extractReceiverName`, `extractReceiverNode`, and a `selector` handler in `extractMixedChain` for Dart's flat sibling-selector model (vs the nested member-expression model used by all other languages). **Integration tests** — New `dart.test.ts` with field-type resolution and call-result-binding describe blocks. Fixtures: `dart-field-types/` (models.dart + app.dart) and `dart-call-result-binding/` (models.dart + app.dart). 9 passing tests, 1 skipped (ACCESSES edges for field reads depend on type-env parameter binding propagation — tracked for follow-up).
ff5adf0 to
19fa5d7
Compare
|
@xFlaviews Let me know what you think 🙏 There's one integration test skipped and if you could look into it that would be amazing :) |
CI Report✅ All checks passed Pipeline Status
Test Results
✅ All 4354 tests passed 2 test(s) skipped — expand for details
Code CoverageTests
📋 View full run · Generated by CI |
|
Dont worry about it! I'm defierring it into #494 |
…ing-gaps # Conflicts: # gitnexus/src/core/ingestion/languages/dart.ts
|
@claude Let's run a final review if this PR is production ready and ready to be merged |
|
Claude finished @magyargergo's task in 3m 10s —— View job PR #524 Final Review
Verdict: ✅ Production-ready — safe to mergeCI is green, 4339/4341 tests pass, coverage up across all metrics. The 2 skipped tests are properly documented known limitations. What the PR does (two contributor layers)xFlaviews (original 4 fixes):
magyargergo (5 pipeline fixes with integration tests):
Issues found (all minor, none blocking)1. Non-null assertion on // call-processor.ts:225
const override = provider.labelOverride(current.previousSibling!, finalLabel);
// parse-worker.ts:329
const override = provider.labelOverride(current.previousSibling, finalLabel);
2.
3. When a Dart chain has a call-selector ( What's solid
|
should i do it or it's deferred to #494 ? |
No, I'm doing a much more bigger refactoring and it needs some architectural decision I have in mind. Thank you! Btw, if you want feel free to join to our Discord and if you have more ideas for contribution we'll always welcome it! :) |
* main: (114 commits) feat(csharp): C# MethodExtractor config (abhigyanpatwari#582) docs: add gitnexus-shared build step before gitnexus-web (abhigyanpatwari#585) chore: add enterprise offering section to README, ignore local_docs/ (abhigyanpatwari#579) fix(eval): exclude litellm 1.82.7 and 1.82.8 due to compatibility issues (abhigyanpatwari#580) feat(java,kotlin): MethodExtractor abstraction with per-language configs (abhigyanpatwari#576) feat: added skip-agents-md cli flag (abhigyanpatwari#517) feat(wiki): Azure OpenAI support for wiki command (abhigyanpatwari#562) refactor: reduce explicit any types (abhigyanpatwari#566) feat(java): method references, worker overload disambiguation, interface dispatch (abhigyanpatwari#540) feat: configure eslint with unused import removal (abhigyanpatwari#564) feat: configure prettier with pre-commit hook (abhigyanpatwari#563) feat: unify web and cli ingestion pipeline (abhigyanpatwari#536) fix/opencode mcp gitnexus timeout (abhigyanpatwari#363) chore: bump version to 1.4.10, update CHANGELOG fix: resolve tree-sitter peer dependency conflicts (abhigyanpatwari#538) chore: bump version to 1.4.9, add CHANGELOG.md refactor: Phase 8 & 9 — Field Types and Return-Type Binding (abhigyanpatwari#494) feat: add COBOL language support with regex extraction pipeline (abhigyanpatwari#498) fix: close remaining Dart language support gaps (abhigyanpatwari#524) refactor: split global BUILT_IN_NAMES into per-language provider fields (abhigyanpatwari#523) ... # Conflicts: # gitnexus/src/core/wiki/llm-client.ts
* fix: close remaining Dart language support gaps Four issues that were not addressed in PR abhigyanpatwari#204: 1. extractFunctionName: add function_signature/method_signature handlers and add both to FUNCTION_NODE_TYPES. Without this, findEnclosingFunctionId cannot resolve Dart function scopes — all calls inside Dart functions have no sourceId, breaking CALLS edge attribution. 2. formal_parameter_list: add to paramListTypes in extractMethodSignature. Dart's tree-sitter grammar uses this node type (not formal_parameters), so parameter counting returns 0 for all Dart functions. 3. Write-access queries: add @assignment patterns for obj.field = value and this.field = value. Without these, no ACCESSES write edges are emitted for Dart code. 4. initialized_identifier guard in extractDartDeclaration: comma-separated declarations (String a, b, c) produce initialized_identifier nodes which are in DART_DECLARATION_NODE_TYPES but were unhandled — the type lives on the parent node. Also adds Dart column to the feature matrix in type-resolution-system.md. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(dart): field-type resolution, call attribution, import resolution, and integration tests Fixes five Dart language support gaps with integration tests and architectural alignment: **Tree-sitter queries** — Add field declaration patterns for typed and nullable class fields (`String name = ''`, `String? name`). Without these, Dart class fields were invisible to the pipeline (zero Property nodes, zero HAS_PROPERTY edges). **Import resolution** — Dart relative imports (`import 'models.dart'`) don't use a leading `./`. The standard resolver only recognises paths starting with `.` as relative; bare paths fell through to a Java-style dot-to-slash conversion that mangled `models.dart` into `models/dart`. Fix: prepend `./` before calling resolveStandard. **Call attribution** — Dart's tree-sitter grammar places `function_body` as a sibling of `function_signature`, not as a child wrapping both. The `findEnclosingFunction` parent-walk never found the function because the call lives inside `function_body` which is a sibling of the signature. Fix: add `enclosingFunctionFinder` hook to LanguageProvider interface (following the same strategy pattern as `labelOverride`), with the Dart-specific logic in `languages/dart.ts`. Both `parse-worker.ts` and `call-processor.ts` consume the hook generically — no Dart-specific code in the generic processors. **Receiver chain extraction** — Add `unconditional_assignable_selector` to `MEMBER_ACCESS_NODE_TYPES` so `inferCallForm` returns `'member'` for Dart method calls. Add Dart-specific receiver extraction blocks in `extractReceiverName`, `extractReceiverNode`, and a `selector` handler in `extractMixedChain` for Dart's flat sibling-selector model (vs the nested member-expression model used by all other languages). **Integration tests** — New `dart.test.ts` with field-type resolution and call-result-binding describe blocks. Fixtures: `dart-field-types/` (models.dart + app.dart) and `dart-call-result-binding/` (models.dart + app.dart). 9 passing tests, 1 skipped (ACCESSES edges for field reads depend on type-env parameter binding propagation — tracked for follow-up). --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Gergo Magyar <gergomagyar@icloud.com>
Summary
Fixes 4 gaps in the Dart language support that were not addressed in PR #204:
extractFunctionName+FUNCTION_NODE_TYPES: PR feat: add Dart language support #204 moved@definition.functionontofunction_signaturenodes but never added them toFUNCTION_NODE_TYPESorextractFunctionName. Without this,findEnclosingFunctionIdcan't resolve Dart function scopes — all CALLS edges from inside Dart functions have nosourceId, breaking call attribution.formal_parameter_listinparamListTypes: Dart's tree-sitter grammar usesformal_parameter_list(notformal_parameters). Without adding it toparamListTypes,extractMethodSignaturereturnsparameterCount: 0for every Dart function.Write-access queries: PR feat: add Dart language support #204 has no
@assignmentpatterns for Dart. Without them, noACCESSES writeedges are emitted —obj.field = valueandthis.field = valueare invisible to the graph. Every other language (except C) has these.initialized_identifierguard:DART_DECLARATION_NODE_TYPESincludesinitialized_identifier(for comma-separated declarations likeString a, b, c), butextractDartDeclarationonly handledinitialized_variable_definition. Variables after the first comma silently got no type binding because the type lives on the parent node.Also adds Dart column to the feature matrix in
type-resolution-system.md.Changed files
ast-helpers.tsfunction_signature/method_signaturetoFUNCTION_NODE_TYPESandextractFunctionName; addformal_parameter_listtoparamListTypestree-sitter-queries.tstype-extractors/dart.tsinitialized_identifierguard inextractDartDeclarationtype-resolution-system.mdTest plan
tsc --noEmitpasseselse ifbranches, new set entries, new query patterns)🤖 Generated with Claude Code