This is item 3 of t84 (the backlog: VB, .aspx, .cshtml, .razor). It comes as two stacked PRs:
This PR: Visual Basic .NET in the code graph.
Next PR, on top of this one:.razor, .cshtml and Web Forms .aspx/.ascx/.master. It needs the VB parser for pages written in VB.
What the graph gets from VB
Nodes: classes, modules, structures, interfaces and enums; methods and constructors (Type.New).
Edges:
Inherits and Implements, kept apart as VB states them (no I-prefix guessing as in C#);
calls: x.Find(id), Init without parentheses, and New Pump(3).
Entry points: the same rules as C#, compared case-insensitively since VB is:
Main in a Module, or Shared Sub Main;
<HttpGet>/<WebMethod>-style attributes;
ProcessRequest of an IHttpHandler;
public or protected members of controllers, Web Forms pages and controls, and ASMX services;
any method with a Handles clause (WinForms and Web Forms event handlers).
Grammar and runtime
Grammar:tree-sitter-vb-dotnet = "=0.1.0", MIT, pinned exactly like tree-sitter-c-sharp.
Provenance:
The crate is published from a fork, jamie8johnson/tree-sitter-vb-dotnet, of CodeAnt-AI/tree-sitter-vb-dotnet.
grammar.js, src/parser.c, src/grammar.json and src/node-types.json are byte-identical to upstream CodeAnt-AI.
build.rs is the standard tree-sitter one: it compiles parser.c, nothing else.
The Cargo.lock checksum equals the sha256 of the reviewed archive.
Runtime 0.24 → 0.25: the grammar is generated for ABI 15, which tree-sitter 0.24 can't load. 0.25 still loads the existing ABI-14 grammars (Rust, Python, JS, TS, C, C#) with no code change, and the 108 graph tests pass.
Known gaps in the grammar, handled here:
It expects Inherits/Implements on the Class line, but VB writes them on the next lines. Base types are therefore read from the lines that open the block, including the Class A : Inherits B form.
It doesn't parse Handles clauses, LINQ queries or Dim x As New T(). The members around them still come out (tested with a LINQ query in a method body). A Handles clause is recognised from the method's header line.
Also
obj/: the graph build now skips it, the .NET build output with generated *.g.cs and, later, the Razor compiler's *.razor.g.cs. bin/ stays in, because Rust keeps sources in src/bin.
Dashboard: the language is named "Visual Basic" on the graph card and in the explorer.
Control checks:.vb joins the extensions the surface retrieval reads.
Tests
VB parser:
nodes, including a module and a constructor;
the line span of a method after a LINQ line;
entry points, including Handles, a lowercase handles and <WebMethodAttribute()>;
Inherits/Implements edges with their lines, including generics and the : form;
calls with and without parentheses, and New.
Registry: a Windows-1252 VB file parses, and obj/ is left out.
Dashboard:language_list names "C#, Visual Basic".
Ran locally:
fmt;
clippy -D warnings on core, agent, graph, mcp, werkbank-exec, control-map, and dashboard with server and with web;
lib tests (agent 1021, core 209, graph 108, werkbank-exec, control-map) and dashboard server tests;
agent integration tests against Mongo: 97 passed, 0 failed.
## What
This is item 3 of t84 (the backlog: VB, .aspx, .cshtml, .razor). It comes as two stacked PRs:
- **This PR:** Visual Basic .NET in the code graph.
- **Next PR, on top of this one:** `.razor`, `.cshtml` and Web Forms `.aspx`/`.ascx`/`.master`. It needs the VB parser for pages written in VB.
### What the graph gets from VB
- **Nodes:** classes, modules, structures, interfaces and enums; methods and constructors (`Type.New`).
- **Edges:**
- `Inherits` and `Implements`, kept apart as VB states them (no `I`-prefix guessing as in C#);
- calls: `x.Find(id)`, `Init` without parentheses, and `New Pump(3)`.
- **Entry points:** the same rules as C#, compared case-insensitively since VB is:
- `Main` in a `Module`, or `Shared Sub Main`;
- `<HttpGet>`/`<WebMethod>`-style attributes;
- `ProcessRequest` of an `IHttpHandler`;
- public or protected members of controllers, Web Forms pages and controls, and ASMX services;
- any method with a `Handles` clause (WinForms and Web Forms event handlers).
### Grammar and runtime
- **Grammar:** `tree-sitter-vb-dotnet = "=0.1.0"`, MIT, pinned exactly like `tree-sitter-c-sharp`.
- **Provenance:**
- The crate is published from a fork, jamie8johnson/tree-sitter-vb-dotnet, of CodeAnt-AI/tree-sitter-vb-dotnet.
- `grammar.js`, `src/parser.c`, `src/grammar.json` and `src/node-types.json` are byte-identical to upstream CodeAnt-AI.
- `build.rs` is the standard tree-sitter one: it compiles `parser.c`, nothing else.
- The `Cargo.lock` checksum equals the sha256 of the reviewed archive.
- **Runtime 0.24 → 0.25:** the grammar is generated for ABI 15, which tree-sitter 0.24 can't load. 0.25 still loads the existing ABI-14 grammars (Rust, Python, JS, TS, C, C#) with no code change, and the 108 graph tests pass.
- **Known gaps in the grammar, handled here:**
- It expects `Inherits`/`Implements` on the `Class` line, but VB writes them on the next lines. Base types are therefore read from the lines that open the block, including the `Class A : Inherits B` form.
- It doesn't parse `Handles` clauses, LINQ queries or `Dim x As New T()`. The members around them still come out (tested with a LINQ query in a method body). A `Handles` clause is recognised from the method's header line.
### Also
- **`obj/`:** the graph build now skips it, the .NET build output with generated `*.g.cs` and, later, the Razor compiler's `*.razor.g.cs`. `bin/` stays in, because Rust keeps sources in `src/bin`.
- **Dashboard:** the language is named "Visual Basic" on the graph card and in the explorer.
- **Control checks:** `.vb` joins the extensions the surface retrieval reads.
## Tests
- **VB parser:**
- nodes, including a module and a constructor;
- the line span of a method after a LINQ line;
- entry points, including `Handles`, a lowercase `handles` and `<WebMethodAttribute()>`;
- `Inherits`/`Implements` edges with their lines, including generics and the `:` form;
- calls with and without parentheses, and `New`.
- **Registry:** a Windows-1252 VB file parses, and `obj/` is left out.
- **Dashboard:** `language_list` names "C#, Visual Basic".
Ran locally:
- fmt;
- clippy `-D warnings` on core, agent, graph, mcp, werkbank-exec, control-map, and dashboard with `server` and with `web`;
- lib tests (agent 1021, core 209, graph 108, werkbank-exec, control-map) and dashboard server tests;
- agent integration tests against Mongo: 97 passed, 0 failed.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
VB.NET classes, modules, structures, interfaces and enums, their methods
and constructors, base types and calls are now nodes and edges, with the
same entry-point rules as C#: Main, ASP.NET controller actions, Web Forms
pages and controls, ASMX web methods, HTTP handlers, and event handlers
wired with Handles.
The grammar is CodeAnt-AI's tree-sitter-vb-dotnet (MIT, pinned 0.1.0,
grammar files identical to upstream). It is generated for ABI 15, so the
tree-sitter runtime moves from 0.24 to 0.25, which still loads the
existing ABI-14 grammars unchanged. The grammar expects Inherits and
Implements on the Class line, so base types are read from the lines that
open the block instead.
The graph build now skips obj/, where .NET writes generated sources, and
the dashboard names the language "Visual Basic".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
This is item 3 of t84 (the backlog: VB, .aspx, .cshtml, .razor). It comes as two stacked PRs:
.razor,.cshtmland Web Forms.aspx/.ascx/.master. It needs the VB parser for pages written in VB.What the graph gets from VB
Type.New).InheritsandImplements, kept apart as VB states them (noI-prefix guessing as in C#);x.Find(id),Initwithout parentheses, andNew Pump(3).Mainin aModule, orShared Sub Main;<HttpGet>/<WebMethod>-style attributes;ProcessRequestof anIHttpHandler;Handlesclause (WinForms and Web Forms event handlers).Grammar and runtime
tree-sitter-vb-dotnet = "=0.1.0", MIT, pinned exactly liketree-sitter-c-sharp.grammar.js,src/parser.c,src/grammar.jsonandsrc/node-types.jsonare byte-identical to upstream CodeAnt-AI.build.rsis the standard tree-sitter one: it compilesparser.c, nothing else.Cargo.lockchecksum equals the sha256 of the reviewed archive.Inherits/Implementson theClassline, but VB writes them on the next lines. Base types are therefore read from the lines that open the block, including theClass A : Inherits Bform.Handlesclauses, LINQ queries orDim x As New T(). The members around them still come out (tested with a LINQ query in a method body). AHandlesclause is recognised from the method's header line.Also
obj/: the graph build now skips it, the .NET build output with generated*.g.csand, later, the Razor compiler's*.razor.g.cs.bin/stays in, because Rust keeps sources insrc/bin..vbjoins the extensions the surface retrieval reads.Tests
Handles, a lowercasehandlesand<WebMethodAttribute()>;Inherits/Implementsedges with their lines, including generics and the:form;New.obj/is left out.language_listnames "C#, Visual Basic".Ran locally:
-D warningson core, agent, graph, mcp, werkbank-exec, control-map, and dashboard withserverand withweb;🤖 Generated with Claude Code