codebase-memory-mcp icon indicating copy to clipboard operation
codebase-memory-mcp copied to clipboard

feat: add VB.NET (.vb) tree-sitter structural extraction

Open ankitsusheel opened this issue 4 months ago • 2 comments

feat: add VB.NET (.vb) tree-sitter structural extraction

Current behavior (verified on main @ 94c8e96)

Indexing a repository containing .vb files completes with status: "indexed" and produces zero nodes for the VB.NET code — not even File nodes — with no warning and no counter incremented (skipped_count: 0, not_indexed_files_count: 0). .vb has no EXT_TABLE[] entry, so discovery drops the files before the file list is built (src/discover/discover.c:717-720), deliberately without recording them as ignored (per #963). VB.NET codebases — including the large installed base of WinForms line-of-business apps being migrated to the web — are silently invisible to the graph.

Proposal

Add VB.NET as a supported language ("Also supported (not yet benchmarked)" tier — no benchmark-tier claim), targeting real-world WinForms code as the acceptance bar: partial classes split across Form1.vb / Form1.Designer.vb, WithEvents fields, Handles clauses, AddHandler/AddressOf wiring, #Region, attribute _ line continuations, As New initializers.

Grammar

CodeAnt-AI/tree-sitter-vb-dotnet (MIT declared, ABI 15, no external scanner) is the only tree-sitter grammar targeting VB.NET specifically. Standalone parse testing found it cannot parse several core VB.NET forms as shipped: next-line/colon-form Inherits/Implements (the standard syntax — misparsed as field declarations), Handles clauses, AddHandler/RemoveHandler/RaiseEvent statements, As New T(), member-level #Region, nested types, and attribute-with-_-continuation (the WinForms Designer file shape). The vendored copy therefore regenerates parser.c from a locally patched grammar.js; the full diff is vendored as grammar.js.patch and documented in the grammar MANIFEST, and the patches should be proposed upstream. Additional flags: single contributor, 13 commits, no tags (pinned by SHA cfca210), and no LICENSE file upstream (MIT is metadata-only; the vendored LICENSE carries the standard MIT text per the move/zsh convention).

Design decisions needing maintainer review

  1. Partial-class identity: one Class node per file (path-derived QNs), matching how C# partial is (not) handled today. No cross-file merge pass introduced. Cross-file wiring still works via name resolution (verified: a Handles reference in Form1.vb resolves to the WithEvents field declared in Form1.Designer.vb).
  2. Case-insensitive identifiers: NOT implemented — registry.c untouched; VB names are emitted as written. Consistent-casing code (the norm) resolves fine; mixed-case references are a documented limitation.
  3. Event wiring: reuses the existing USAGE machinery (Handles/AddHandler targets and AddressOf handlers resolve against extracted Field/Method nodes). No new edge type; HANDLES remains route-scoped.
  4. Namespaces are QN-transparent and Module/Structure blocks label as "Class", both matching the established C# behavior.

Out of scope

Hybrid LSP semantic resolution and Excellent/Good/Functional benchmark-tier classification remain future work.

ankitsusheel avatar Jul 19 '26 13:07 ankitsusheel

Thanks for opening the language request alongside PR #1179. This is tracked as a backlog language expansion for 0.9.2-rc. The current PR has received supply-chain and correctness rework feedback: any grammar must come from a pinned, license-verified upstream source and be regenerated and vendored by maintainers rather than accepted from contributor-generated parser output. The issue remains open for the capability request, but the milestone is not an implementation commitment until that design and provenance review is complete.

DeusData avatar Jul 22 '26 16:07 DeusData

Thank you for the detailed VB.NET capability request and explicit limitations. I have no new acceptance decision to report; grammar provenance/licensing and the partial-class, casing, and event-wiring choices still need maintainer review before an implementation commitment.

DeusData avatar Oct 19 '26 22:10 DeusData