Skip to content

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

Description

@ankitsusheel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlanguage-requestRequest for new language supportparsing/qualityGraph extraction bugs, false positives, missing edgespriority/backlogValuable contribution, lower scheduling urgency; review when maintainer capacity opens.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions