Skip to content

feat: add Dart/Flutter language support#83

Closed
xFlaviews wants to merge 1 commit into
abhigyanpatwari:mainfrom
xFlaviews:feature/dart-flutter-support
Closed

feat: add Dart/Flutter language support#83
xFlaviews wants to merge 1 commit into
abhigyanpatwari:mainfrom
xFlaviews:feature/dart-flutter-support

Conversation

@xFlaviews

Copy link
Copy Markdown
Contributor

Summary

Adds comprehensive Dart/Flutter support to GitNexus as the 11th supported language, following the existing 6-layer language support architecture.

  • 11 files modified, 286 insertions — covers all layers: enum registration, parser loading, file extension mapping, tree-sitter queries, import resolution, export detection, framework detection, entry point scoring, and built-in filtering
  • Tested on a real-world Flutter app: 17,381 nodes, 28,985 edges indexed in 5.1 seconds
  • Handles Dart-specific patterns: package: URI imports (resolved via pubspec.yaml), _ prefix visibility, Flutter widget lifecycle, mixin heritage

What's included

Layer What was added
Language enum Dart in SupportedLanguages
Parser loading tree-sitter-dart grammar (main + worker threads)
File extension .dartSupportedLanguages.Dart
Tree-sitter queries Classes, mixins, enums, extensions, type aliases, functions, methods, imports (with package: URI), exports, 4 call patterns (direct, method, return, assignment), heritage (extends, implements, with)
Import resolution package:<name>/path.dartlib/path.dart, relative imports, skip dart: SDK
Export detection _ prefix = private, no prefix = public
Framework detection Flutter path patterns: main.dart (3.0×), pages/screens/views (2.5×), routes (2.5×), presentation (2.0×), widgets (1.5×)
Entry point scoring main, build, initState, dispose, createState, *Widget, *Page, *Screen, *Controller, *Notifier, *Provider
Built-in filtering setState, initState, dispose, runApp, print, debugPrint, etc.

⚠️ Note on tree-sitter-dart npm package

The published tree-sitter-dart@1.0.0 on npm uses legacy nan native bindings, which are incompatible with tree-sitter@^0.21.0 (requires node-addon-api / NAPI).

Workaround: rebuild from source:

git clone https://github.com/UserNobody14/tree-sitter-dart /tmp/ts-dart-src
cd /tmp/ts-dart-src
npx tree-sitter-cli@0.22.6 generate
npx node-gyp rebuild
cd /path/to/gitnexus
npm install /tmp/ts-dart-src

Long-term fix: publish a NAPI-compatible version of tree-sitter-dart, or vendor the rebuilt grammar.

Test results

Analyzed a production Flutter codebase (~1,200 Dart files):

Nodes: 17,381
Edges: 28,985
Time:  5.1s

Heritage (extends/implements/with), imports, and call graphs all resolve correctly. Verified against sample files with mixins (both with and extends ... with), package: imports, and nested method calls.

Test plan

  • TypeScript compiles clean (npx tsc --noEmit)
  • Existing language tests still pass (no regressions)
  • Dart definitions extracted (classes, mixins, enums, extensions, functions, methods)
  • package: imports resolve correctly via pubspec.yaml
  • Relative imports resolve correctly
  • dart: SDK imports are skipped
  • Export directives create dependency edges
  • Call graph captures direct, method, return, and assignment calls
  • Heritage: extends, implements, and with mixins all resolve
  • _ prefix correctly marks symbols as private
  • Flutter framework paths get appropriate entry point score boosts
  • Built-in functions (setState, print, etc.) are filtered from call graph
  • Tested on real Flutter codebase (17K+ nodes, 29K+ edges)

🤖 Generated with Claude Code

@vercel

vercel Bot commented Feb 26, 2026

Copy link
Copy Markdown

@xFlaviews is attempting to deploy a commit to the NexusCore Team on Vercel.

A member of the Team first needs to authorize it.

@abhigyanpatwari

Copy link
Copy Markdown
Owner

Thanks for this, will review

@xFlaviews

Copy link
Copy Markdown
Contributor Author

working on our social network and as we are using flutter i couldn't use the tool haha

thank you! lmk if it needs any changes

@abhigyanpatwari

Copy link
Copy Markdown
Owner

PR #83 Review: Dart/Flutter Language Support

+286 / -0 across 11 files

Well-structured PR that follows the existing 6-layer language support architecture. The contributor clearly studied how the other 10 languages were added. However, there are several issues that need to be addressed before merging.


CRITICAL / BUGS

BUG-1: tree-sitter-dart@1.0.0 is known-incompatible but added to package.json

The PR description itself warns that the published npm package uses legacy nan bindings, incompatible with tree-sitter@^0.21.0. Adding "tree-sitter-dart": "^1.0.0" means npm install will pull the broken version, causing a runtime crash for anyone trying Dart indexing. This needs to be resolved before merge — either vendor a rebuilt grammar in vendor/, gate it behind a graceful fallback, or don't ship it until a compatible npm package exists.

BUG-2: method_signature missing from FUNCTION_NODE_TYPES in call-processor.ts

In parse-worker.ts (worker thread), BOTH function_signature and method_signature are added. But in call-processor.ts (main thread fallback), only function_signature is added. This means the main-thread findEnclosingFunction won't recognize method_signature nodes, so calls inside Dart class methods will be mis-attributed to file-level scope.

BUG-3: No name-extraction logic for function_signature in main-thread findEnclosingFunction

call-processor.ts has explicit branches for function_declaration, method_declaration, etc., but none for function_signature. When the main-thread path encounters a Dart function, funcName will remain null.


ISSUES

ISSUE-1 (High): Method calls query is dead code — missing @call outer capture

(unconditional_assignable_selector
  (identifier) @call.name)

This has @call.name but no @call on a parent node. The processing code in both call-processor.ts and parse-worker.ts checks if (captureMap['call']) — without it, these matches are silently dropped. Method calls (the most common Dart call pattern) won't appear in the call graph.

ISSUE-2 (Medium): Direct/return/assignment call queries are context-limited

The call queries only match calls inside expression_statement, return_statement, and initialized_variable_definition. Calls inside if conditions, as arguments to other calls, in list literals, ternary expressions, etc. won't be captured. Other languages use a generic call_expression node that matches anywhere in the tree.

ISSUE-3 (Medium): Dart import resolution differs subtly between the two code paths

processImports and processImportsFromExtracted have duplicated Dart logic with subtle differences (e.g., the fast path handles bare relative imports differently). Should be extracted into a shared resolveDartImport() function, following the pattern of resolvePhpImport() / resolveGoPackage().

ISSUE-4 (Low): Mixin heritage uses @heritage.implements instead of @heritage.trait

Dart mixins are semantically closer to Rust traits / PHP traits. Using @heritage.implements records them as kind: 'implements' rather than kind: 'trait-impl'. This is semantically incorrect.


STYLE / CONSISTENCY

  • Mixins captured as @definition.class — should be @definition.trait (like PHP/Rust traits)
  • Extensions captured as @definition.class — should be @definition.impl or similar
  • Top-level function query wraps in (program ...) — no other language does this; the @definition.function capture ends up on the program root node
  • Mixin query uses positional (identifier) instead of field-based name: (identifier)

SUGGESTIONS

  1. Vendor the tree-sitter-dart grammar (or add graceful try/catch around the import)
  2. Extract Dart import resolution into a shared function to eliminate duplication
  3. Expand the built-ins list (missing common Flutter/Dart SDK noise: where, map, fold, toList, forEach, Navigator.*, etc.)
  4. Consider adding p.includes('/test/') && p.endsWith('.dart') to test file detection alongside _test.dart

Summary

Severity Count Key Items
Critical 1 Incompatible npm dependency will crash on install
Bug 2 Missing method_signature in main-thread, no name extraction for Dart node types
High Issue 1 Method call captures are silently dropped (dead code)
Medium Issue 2 Limited call capture contexts, import resolution duplication
Low Issue 1 Mixin heritage semantics
Style 4 Various capture name inconsistencies

Verdict: The architecture and approach are solid — the contributor clearly understands the project's patterns. But the PR needs a revision pass to fix the critical dependency issue, the silent method-call capture drop, and the main-thread/worker-thread inconsistencies before it's merge-ready.

jandyx added a commit to jandyx/GitNexus that referenced this pull request Feb 27, 2026
…, postinstall

- Add init_declaration/deinit_declaration to call-processor FUNCTION_NODE_TYPES
  and findEnclosingFunction (syncs with parse-worker, avoids Dart PR abhigyanpatwari#83 rejection)
- Add 7 missing CodeRelation FROM-TO pairs in schema.ts to eliminate analyze warnings
  (Function→Property, Constructor→Property/Typedef, Enum→Class/Interface,
   Struct→Interface, TypeAlias→Class)
- Mirror all Swift support to gitnexus-web: supported-languages, utils, queries,
  framework-detection, entry-point-scoring, parser-loader WASM path
- Add postinstall script to patch tree-sitter-swift binding.gyp actions array
@magyargergo magyargergo mentioned this pull request Mar 16, 2026
6 tasks
@magyargergo

Copy link
Copy Markdown
Collaborator

Can you please review the type-resolution-system.md and implement the resolution accordingly for these languages. I'd recommend splitting this PR up to focus on one langugae.

@k1r3zz

k1r3zz commented Mar 22, 2026

Copy link
Copy Markdown

Hi! I'm a Flutter developer and really looking forward to this Dart/Flutter support. 🙏

My team is actively building a Flutter app and we'd love to use GitNexus to improve our AI-assisted development workflow — tracking call chains, analyzing impact before changes, and mapping out payment/business logic across our codebase.

Right now without Dart support, GitNexus essentially skips all our core code, which makes it unusable for pure Flutter projects.

Is there anything the community can help with to move this forward? Happy to test on our real-world Flutter project once the issues from the review are addressed.

Really excited about this feature — great work @xFlaviews! 🚀

@cbbfcd

cbbfcd commented Mar 24, 2026

Copy link
Copy Markdown

nice work!

@magyargergo

Copy link
Copy Markdown
Collaborator

@xFlaviews could you please rebase your work on the main branch? 🙏

@abhigyanpatwari

Copy link
Copy Markdown
Owner

@k1r3zz hi, would u be willing to join our discord. We are getting a initial batch of clients to try out our enterprise version for relatively less pricing so we can improve on it. Feel free to dm me if thats ok

Full Dart/Flutter integration into the LanguageProvider architecture:

- Language registration: SupportedLanguages enum, language detection,
  parser loader, provider registry with compile-time exhaustiveness
- Tree-sitter queries: classes, mixins, enums, extensions, type aliases,
  functions, methods, imports, exports, calls, heritage (extends/implements/with)
- Type extractor (450 lines): Tier 0 explicit declarations & parameters,
  Tier 1 constructor inference (incl. named constructors, virtual dispatch,
  literal types), Tier 2 assignment chain propagation (copy, callResult,
  fieldAccess, methodCallResult), for-loop element type resolution,
  null-safe (?.) and await support
- Import resolution: dart: SDK (skip), package: (pubspec.yaml), relative
- Export detection: underscore-prefix convention (_private)
- Framework detection: Flutter widgets, Riverpod providers, lifecycle methods
- Entry point scoring: main, build, initState, dispose, createState patterns
- Noise filtering: Dart/Flutter built-ins (print, setState, runApp, etc.)
- AST helpers: mixin_declaration, extension_declaration container types

Includes postinstall script (scripts/patch-tree-sitter-dart.cjs) that converts
tree-sitter-dart@1.0.0 from NAN to NAPI bindings for worker_threads
compatibility — NAN modules fail with "Module did not self-register" when
loaded concurrently across worker threads alongside NAPI-based parsers.

Rebased on upstream/main (LanguageProvider architecture refactoring).
Tested on waveful_app (731 Dart files): 265K nodes, 825K edges indexed.
Zero TypeScript errors, zero regressions for existing languages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@xFlaviews xFlaviews force-pushed the feature/dart-flutter-support branch from c18d3a3 to 8d93354 Compare March 25, 2026 18:21
@xFlaviews

Copy link
Copy Markdown
Contributor Author

@magyargergo

  • Resolved all 6 merge conflicts from the LanguageProvider refactoring — Dart now uses defineLanguage() like every other language
  • Fixed the tree-sitter-dart NAN/NAPI crash: added a postinstall script (scripts/patch-tree-sitter-dart.cjs) that auto converts the bindings to NAPI so it works in worker threads (same pattern as the existing patch-tree-sitter-swift.cjs)
  • Implemented full type resolution following type-resolution-system.md — Tier 0 through Tier 2, including constructor inference, assignment chains, for-loop bindings, null-safe ?. and await

let me know how if we need anything else

@magyargergo

Copy link
Copy Markdown
Collaborator

@claude ultra-think while identifying Dart/Flutter-language gaps. Perfom this analysis on this pull request and verify those findings. Act as a senior compiler font-end engineer and expert in static analysis tools and review this change from that perpective and review the architectural fit. Also check out previous comments and reason with their requests.

@github-actions

github-actions Bot commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Claude finished @magyargergo's task in 5m 10s —— View job


Dart/Flutter Language Support — Senior Compiler/Static Analysis Review

Reviewed by: @claude (acting as senior compiler front-end engineer / static analysis expert)
Scope: All 21 changed files, verified against previous review comments, type-resolution-system.md, and architectural patterns of the 13 existing languages.


Tasks

  • Read trigger comment and classify request
  • Read changed files (tree-sitter queries, type extractor, import resolver, config layers)
  • Read existing language implementations for architectural comparison
  • Read type-resolution-system.md
  • Audit tree-sitter queries: completeness, correctness, capture naming
  • Audit type extractor against type-resolution-system.md tiers
  • Audit import resolver vs other languages
  • Audit call-processor / parse-worker consistency
  • Audit patch script and dependency story
  • Synthesize findings

Previous Review Status

ID Issue Status
BUG-1 tree-sitter-dart NAN/NAPI crash FIXEDpatch-tree-sitter-dart.cjs mirrors Swift's existing pattern exactly
BUG-2 method_signature absent from FUNCTION_NODE_TYPES FIXED — Both function_signature and method_signature now appear in ast-helpers.ts:86-87; this file is shared between worker and main thread
BUG-3 No name-extraction for function_signature ⚠️ STILL OPEN — see detailed analysis below
ISSUE-1 Method-call query is dead code (no outer @call) ⚠️ STILL OPEN — see detailed analysis below
ISSUE-2 Limited call-capture contexts ⚠️ STILL OPEN — architectural decision needed
ISSUE-3 Dart import-resolution duplication FIXEDresolveDartImport() is a clean shared function
ISSUE-4 Mixin with heritage uses wrong capture ⚠️ STILL OPEN — see detailed analysis below

New Findings (not in previous review)

🔴 NEW-BUG-1 — @definition.function captures program instead of function_signature

File: tree-sitter-queries.ts:1027-1029

(program
  (function_signature
    name: (identifier) @name)) @definition.function   // ← @definition.function is on `program`

Every other language attaches @definition.function to the function node itself. Here it captures the program root. The consequence in parse-worker.ts:1218:

const startLine = definitionNode ? definitionNode.startPosition.row : 
// definitionNode = program → startPosition.row = 0 for ALL top-level Dart functions

Every top-level Dart function (main, factory functions, utility functions) will have startLine: 0 and endLine: <last line of file>. IDs remain correct (they use filePath + name), but all tooling downstream that uses line-range metadata — impact analysis, context snippets, entrypoint scoring — will see wrong ranges.

Fix: [(function_signature name: (identifier) @name)] @definition.function (remove the program wrapper)

Fix this →


🔴 STILL-OPEN BUG-3 — extractFunctionName returns null for function_signature / method_signature

File: ast-helpers.ts:290-444

FUNCTION_NODE_TYPES (line 86-87) correctly includes both Dart node types. But extractFunctionName — which parse-worker.ts calls to build enclosing-function IDs for call attribution — has no branch for them:

if (FUNCTION_DECLARATION_TYPES.has(node.type)) {  }  // function_signature NOT in this set
else if (node.type === 'impl_item') {  }
else if (node.type === 'method_definition') {  }
else if (node.type === 'method_declaration' || node.type === 'constructor_declaration') {  }
// ... no branch for function_signature / method_signature → funcName stays null

Result: findEnclosingFunctionId walks upward past the enclosing Dart method, finds nothing, returns null. All calls inside Dart class methods are attributed to file scope rather than their enclosing method. The call graph is structurally incorrect.

Fix: Add a branch in extractFunctionName for function_signature / method_signature. Both have a name: (identifier) field, so node.childForFieldName('name')?.text works.

Fix this →


🔴 STILL-OPEN ISSUE-1 — Method-call query missing outer @call — dead code

File: tree-sitter-queries.ts:1064-1066

; ── Method calls ─────────────────────────────────────────────────────────────
(unconditional_assignable_selector
  (identifier) @call.name)        // ← no @call on a parent node

parse-worker.ts processes call captures by checking if (captureMap['call']). No @call outer capture means this match is never processed. Method calls — the most common call pattern in Dart OOP code — produce zero call graph edges.

The correct pattern for tree-sitter-dart uses selectorargument_part:

; Method calls: obj.method()
(selector
  (identifier) @call.name
  (argument_part)) @call

Fix this →


🔴 NEW-BUG-2 — No write-access (@assignment) queries for Dart

Every language added in this codebase has write-access capture patterns for ACCESSES edge emission. Dart has none. The absence means user.address = value and similar mutations produce no ACCESSES edges — impact analysis for Dart will miss write paths.

Compare: every other language has:

; Write access: obj.field = value
(assignment_expression
  left: ...receiver... @assignment.receiver
  ...property... @assignment.property
  right: (_)) @assignment

Dart's equivalent would be:

(assignment_expression
  left: (unconditional_assignable_selector
    object: (_) @assignment.receiver
    (identifier) @assignment.property)
  right: (_)) @assignment

Fix this →


🟠 STILL-OPEN ISSUE-4 — Mixin with heritage produces wrong kind

File: tree-sitter-queries.ts:1092-1097

; ── Heritage: with (mixins) ──────────────────────────────────────────────────
(class_definition
  name: (identifier) @heritage.class
  superclass: (superclass
    (mixins
      (type_identifier) @heritage.implements))) @heritage.mixin  // ← wrong capture name

In parse-worker.ts:1189-1195, the @heritage.implements capture produces kind: 'implements'. This is incorrect semantics: Dart with mixins are mixed-in behaviour, not interface contracts. The correct capture is @heritage.trait which routes through the kind: 'trait-impl' path (line 1197-1203).

Fix: Rename @heritage.implements@heritage.trait on line 1097. The outer @heritage.mixin capture is harmless but unused — the routing is entirely determined by the inner capture name.

Fix this →


🟡 NEW-ISSUE-1 — initialized_identifier declared but never handled

File: type-extractors/dart.ts:20-23

const DART_DECLARATION_NODE_TYPES: ReadonlySet<string> = new Set([
  'initialized_variable_definition',
  'initialized_identifier',        // ← registered but no extractor handles this node type
]);

All three extractors (extractDartDeclaration, extractDartInitializer, extractDartPendingAssignment) guard on node.type !== 'initialized_variable_definition'. initialized_identifier covers the second+ declarations in User a, b = User() — the b binding will never have a type inferred.


🟡 NEW-ISSUE-2 — Nullable types bypass the explicit-annotation path

File: type-extractors/dart.ts:118-120, 131-140

hasDartTypeAnnotation and extractDartDeclaration use findChild(node, 'type_identifier'). For User? user = …, the AST wraps the type in nullable_type > type_identifier, making findChild return null (it only looks at direct children). The declaration is then misrouted: it skips extractDartDeclaration (no annotation found) and reaches extractDartInitializer where constructor inference can partially compensate, but User? user; (no initializer) produces no binding at all.

Fix: hasDartTypeAnnotation should also check for nullable_type as a direct child; extractDartDeclaration should unwrap nullable_type before calling extractSimpleTypeName.


🟡 NEW-ISSUE-3 — type-resolution-system.md feature matrix doesn't include Dart

File: type-resolution-system.md (project root)

The matrix at line 376 covers 13 languages; Dart is not listed. The PR introduces a complete Tier 0 / Tier 1 / Tier 2 implementation, so the table needs a Dart column. Based on the implementation:

Feature Dart
Declarations Yes
Parameters Yes (partial — nullable gap)
Initializer / constructor inference Yes
Constructor binding scan Yes
For-loop element types Yes
Pattern binding No
Assignment chains Yes
Write access (ACCESSES write) No (missing queries)

Also, the document's "Supported Languages" section says "13 languages" and lists them; Dart should be added as the 14th.


Addressing @magyargergo's type-resolution-system.md Request

@magyargergo asked for implementation following type-resolution-system.md. This PR does implement the required tiers:

  • Tier 0 (extractDartDeclaration, extractDartParameter) — correct, well-structured
  • Tier 0b for-loop (extractDartForLoopBinding) — thorough, handles await iterables
  • Tier 1 constructor inference (extractDartInitializer, detectDartConstructorType) — correct, validates against ClassNameLookup
  • Tier 2 fixpoint (extractDartPendingAssignment) — correctly covers copy/fieldAccess/callResult/methodCallResult
  • Literal types (inferDartLiteralType) — complete for Dart primitives

The implementation quality is above average for a new language — Swift was the previous addition and it remains "the most minimal" by the doc's own admission. Dart's extractor is more complete than Swift's.

The remaining gaps (nullable types, initialized_identifier) are medium-priority refinements.


Architecture Observations

Patch script is the right pattern — mirrors patch-tree-sitter-swift.cjs exactly, including idempotency checking and graceful degradation. The postinstall hook approach is pragmatic for this NAN→NAPI incompatibility. Long-term the right fix is upstream, but this works.

Import resolver is clean — no duplication, proper null returns for SDK/external packages, correct pubspec.yaml parsing. One edge case: package:myapp/ imports that lack a root package match fall through silently to null (correct), but if pubspec.yaml doesn't exist, all package: imports resolve to null. Consider a log warning in dev mode for discoverability.

Query structure: Three of the four Dart call queries (expression_statement, return_statement, initialized_variable_definition) are context-anchored patterns. Most mature language implementations use flat call_expression / call_expression node queries that match anywhere in the tree. The context-anchoring approach misses calls inside if conditions, while conditions, list literals, and argument positions. This is ISSUE-2 from the original review and remains open.


Priority Summary

Priority Issue Fix Complexity
🔴 Critical NEW-BUG-1: @definition.function on program node 1-line query fix
🔴 Critical ISSUE-1: Method calls dead code (no outer @call) Query rewrite
🔴 Critical BUG-3: extractFunctionName null for function_signature ~10-line branch in ast-helpers.ts
🔴 Critical NEW-BUG-2: Missing write-access queries Add 2 query patterns
🟠 High ISSUE-4: Mixin with maps to kind: 'implements' Rename one capture
🟡 Medium NEW-ISSUE-1: initialized_identifier unhandled Extractor guard fix
🟡 Medium NEW-ISSUE-2: Nullable type bypass hasDartTypeAnnotation fix
🟡 Medium NEW-ISSUE-3: feature matrix not updated Doc update
🟢 Low ISSUE-2: Context-anchored call queries miss many call sites Query restructure

Overall: the architecture is solid and the type-extractor implementation quality is good. The four critical issues (query bugs) are straightforward fixes — the codebase patterns make the correct solutions obvious from the surrounding language implementations.

@magyargergo

Copy link
Copy Markdown
Collaborator

@xFlaviews can you please look at them? 🙏

mrwogu added a commit to mrwogu/GitNexus that referenced this pull request Mar 25, 2026
…ution, broader detection

Incorporate improvements from @xFlaviews' PR abhigyanpatwari#83:

Type extractor (replaced stub with full implementation):
- Tier 0: explicit type annotations with nullable_type unwrapping
- Tier 1: constructor/initializer inference via parseDartRHS()
- Tier 2: assignment chain propagation (copy/fieldAccess/callResult/methodCallResult)
- For-loop element type resolution with await support
- Virtual dispatch detection, literal type inference

Language provider:
- Set importSemantics to 'wildcard' (Dart imports bring everything public)

Framework detection:
- Broader path patterns: removed /lib/ prefix requirement, added app.dart,
  routes/, views/, presentation/, domain/
- Added Riverpod AST patterns (ref.watch, ref.read, AsyncNotifier, Notifier)
- Added ConsumerWidget to Flutter AST patterns

Entry-point scoring:
- Added main, createState, class-suffix patterns (Widget$, Page$, Screen$,
  Controller$, Notifier$, Provider$)

Tree-sitter queries:
- Added call capture in return statements and variable assignments
- Added re-export query (library_export)

Noise filter:
- Added deactivate, reassemble, debugDumpApp, debugDumpRenderTree
mrwogu added a commit to mrwogu/GitNexus that referenced this pull request Mar 25, 2026
…ution, broader detection

Incorporate improvements from @xFlaviews' PR abhigyanpatwari#83:

Type extractor (replaced stub with full implementation):
- Tier 0: explicit type annotations with nullable_type unwrapping
- Tier 1: constructor/initializer inference via parseDartRHS()
- Tier 2: assignment chain propagation (copy/fieldAccess/callResult/methodCallResult)
- For-loop element type resolution with await support
- Virtual dispatch detection, literal type inference

Language provider:
- Set importSemantics to 'wildcard' (Dart imports bring everything public)

Framework detection:
- Broader path patterns: removed /lib/ prefix requirement, added app.dart,
  routes/, views/, presentation/, domain/
- Added Riverpod AST patterns (ref.watch, ref.read, AsyncNotifier, Notifier)
- Added ConsumerWidget to Flutter AST patterns

Entry-point scoring:
- Added main, createState, class-suffix patterns (Widget$, Page$, Screen$,
  Controller$, Notifier$, Provider$)

Tree-sitter queries:
- Added call capture in return statements and variable assignments
- Added re-export query (library_export)

Noise filter:
- Added deactivate, reassemble, debugDumpApp, debugDumpRenderTree
mrwogu added a commit to mrwogu/GitNexus that referenced this pull request Mar 25, 2026
…ution, broader detection

Incorporate improvements from @xFlaviews' PR abhigyanpatwari#83:

Type extractor (replaced stub with full implementation):
- Tier 0: explicit type annotations with nullable_type unwrapping
- Tier 1: constructor/initializer inference via parseDartRHS()
- Tier 2: assignment chain propagation (copy/fieldAccess/callResult/methodCallResult)
- For-loop element type resolution with await support
- Virtual dispatch detection, literal type inference

Language provider:
- Set importSemantics to 'wildcard' (Dart imports bring everything public)

Framework detection:
- Broader path patterns: removed /lib/ prefix requirement, added app.dart,
  routes/, views/, presentation/, domain/
- Added Riverpod AST patterns (ref.watch, ref.read, AsyncNotifier, Notifier)
- Added ConsumerWidget to Flutter AST patterns

Entry-point scoring:
- Added main, createState, class-suffix patterns (Widget$, Page$, Screen$,
  Controller$, Notifier$, Provider$)

Tree-sitter queries:
- Added call capture in return statements and variable assignments
- Added re-export query (library_export)

Noise filter:
- Added deactivate, reassemble, debugDumpApp, debugDumpRenderTree
mrwogu added a commit to mrwogu/GitNexus that referenced this pull request Mar 25, 2026
…ution, broader detection

Incorporate improvements from @xFlaviews' PR abhigyanpatwari#83:

Type extractor (replaced stub with full implementation):
- Tier 0: explicit type annotations with nullable_type unwrapping
- Tier 1: constructor/initializer inference via parseDartRHS()
- Tier 2: assignment chain propagation (copy/fieldAccess/callResult/methodCallResult)
- For-loop element type resolution with await support
- Virtual dispatch detection, literal type inference

Language provider:
- Set importSemantics to 'wildcard' (Dart imports bring everything public)

Framework detection:
- Broader path patterns: removed /lib/ prefix requirement, added app.dart,
  routes/, views/, presentation/, domain/
- Added Riverpod AST patterns (ref.watch, ref.read, AsyncNotifier, Notifier)
- Added ConsumerWidget to Flutter AST patterns

Entry-point scoring:
- Added main, createState, class-suffix patterns (Widget$, Page$, Screen$,
  Controller$, Notifier$, Provider$)

Tree-sitter queries:
- Added call capture in return statements and variable assignments
- Added re-export query (library_export)

Noise filter:
- Added deactivate, reassemble, debugDumpApp, debugDumpRenderTree
@magyargergo

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! This has been superseded by #204.

@xFlaviews

xFlaviews commented Mar 26, 2026

Copy link
Copy Markdown
Contributor Author

ah was working on the changes you asked haha and some improvements haha, dope!

created a new PR addressing other flaws #524

also

motolese pushed a commit to motolese/datamoto-gitnexus that referenced this pull request Apr 23, 2026
…, postinstall

- Add init_declaration/deinit_declaration to call-processor FUNCTION_NODE_TYPES
  and findEnclosingFunction (syncs with parse-worker, avoids Dart PR abhigyanpatwari#83 rejection)
- Add 7 missing CodeRelation FROM-TO pairs in schema.ts to eliminate analyze warnings
  (Function→Property, Constructor→Property/Typedef, Enum→Class/Interface,
   Struct→Interface, TypeAlias→Class)
- Mirror all Swift support to gitnexus-web: supported-languages, utils, queries,
  framework-detection, entry-point-scoring, parser-loader WASM path
- Add postinstall script to patch tree-sitter-swift binding.gyp actions array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants