Repository navigation
feat: add Visual Basic .NET support - #2885
jorgeluisblanco wants to merge 1 commit into
Conversation
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
Signed-off-by: jorge blanco <jorge.luis.blanco@hotmail.com>
9822399 to
7d6982c
Compare
|
Thank you, @jorgeluisblanco, for this VB.NET contribution, and welcome! This is a careful piece of work. The language wiring follows the existing C# and .NET patterns closely. The Inherits/Implements, field, import and constructor extraction is easy to follow. You updated every registration tripwire (call-node manifest, capability ledger, label goldens) consistently. The grammar provenance is written down clearly: the upstream pin, the byte-identical MIT LICENSE, and credit for the patch you built on. That makes our side of the review much easier. I want to be upfront about how grammar changes work here, so nothing in this comment comes as a surprise later. We vendor third-party grammar code ourselves: we pin the upstream source, verify the licenses, regenerate the parser and do the vendoring in-house, rather than merging generated parser output from a pull request. That is the same note we left on #1178 for the earlier VB.NET work. The files involved here are everything under There is also an older open pull request for the same language, #1179, and both touch the same language slot. We would like to look at the VB.NET grammar choice and the open VB-family pull requests together instead of deciding them one at a time. Some questions are still open on our side, such as which grammar to use, how VB.NET and VB6 share aliases like Nothing is needed from you right now. We will come back to you here once we have decided how the grammar side will proceed. For when you next touch the branch: the only red CI check is Thanks again for putting this much care into it, and sorry in advance for the wait while we sort out the grammar side. |
|
Hi @jorgeluisblanco, thank you for your patience while this was on hold. As promised on 3 November, we have now decided the VB.NET grammar choice and the open VB-family pull requests together, and we want to explain the reasoning here. There are two VB.NET pull requests: this one, and #1179, which is built on a different grammar, CodeAnt-AI/tree-sitter-vb-dotnet. That grammar has no license file upstream, so it cannot be vendored by anyone. The grammar you chose, govindbanura/tree-sitter-vbnet, is MIT-licensed, and that is the one we will use. Like every third-party grammar, we vendor it ourselves in our own pull request: we pin the upstream source, verify the license, regenerate the parser and record its provenance in-house. That pull request lands first. To avoid two competing VB.NET extractors, VB.NET extraction will land through one pull request, #1179, which we port onto that same grammar ourselves. Your work carries into it: the case-insensitive name resolution (VB.NET resolves names case-insensitively, and so will we), and anything else this PR covers that #1179 does not, credited to you with a Co-authored-by line. Two more decisions: Once that has landed, we will close this PR pointing at the merged result. Nothing is needed from you in the meantime. Thank you for choosing a properly licensed grammar, for the case-insensitive resolution, and for your patience. |
Vendors govindbanura/tree-sitter-vbnet (MIT, (c) 2025 Govind Banura) at 538b7087bf80 (tag v0.1-beta, upstream HEAD) with CodeGraph's real-world VB.NET patch (colbymchenry/codegraph docs/grammars/tree-sitter-vbnet.patch at fe7542b6f6a4, MIT, (c) 2026 Colby Mchenry), as a self-maintained fork in tools/tree-sitter-vbnet/. This is the precondition for VB.NET extraction (DeusData#1179, folding in DeusData#2885); it registers no language yet. Why this grammar: it is the licensed one. CodeAnt-AI/tree-sitter-vb-dotnet, which DeusData#1179 was built on, carries no license and cannot be vendored. Why the patch: upstream checks in grammar.js only and does not parse the code VB.NET projects are made of. Unpatched, the Single literals in every WinForms .Designer.vb (New SizeF(6.0!, 13.0!)) and body-less MustOverride members are ERROR nodes. The 2026-10-06 revision of the patch is pinned because it also keeps names that begin with a keyword whole: the earlier revision (the one DeusData#2885 carried) turns `Sub NewItem()` into an ERROR and `Public SharedCache As Integer` into a Shared field named Cache. Provenance by hash: the patch file is byte-identical to CodeGraph's (blob 37918d8); upstream grammar.js at the pin is the patch's pre-image (21c8523), and tools/tree-sitter-vbnet/grammar.js minus its 41-line provenance header is the post-image (c9c1d85), as is scanner.c (8334fdb). parser.c is generated here with tree-sitter-cli 0.25.10 (ABI 15); two independent generations are byte-identical. No upstream script, package hook or binary was run or vendored. - internal/cbm/vendored/grammars/vbnet/: the generated parser.c, CodeGraph's external scanner.c (two stateless tokens), the tree_sitter/ headers, upstream's MIT LICENSE byte-identical, and CodeGraph's MIT text as LICENSE-codegraph: the scanner and the patched rules are CodeGraph's work, so its notice has to ship with the binary too. - internal/cbm/grammar_vbnet.c: compiles and links tree_sitter_vbnet. No CBMLanguage, extension or alias routes to it yet; extraction adds them, with `vb` and `visualbasic` meaning VB.NET (VB6 keeps its own name). - MANIFEST.md (fork note, forks table, 163 grammars, ABI recount), THIRD_PARTY.md (fork list and a vbnet section; the stale "160 pre-generated parsers" now reads 163), scripts/vendored-checksums.txt, and the FORKS entry in scripts/audit-license-provenance.py. - README.md and the Chocolatey nuspec say 163 languages: the language-count contract defines the count as the vendored grammar directories. - tests/test_parse_coverage.c: real VB.NET (a WinForms Designer partial class, Handles, Inherits/Implements, MustOverride, #Region, Property, keyword-prefixed names) parses with no ERROR node. The case fails on unpatched upstream (8 ERROR nodes) and on the earlier patch revision (1). Refs DeusData#1178, DeusData#1179, DeusData#2885 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Summary
.vb) language discovery and configurationValidation
Fixes #1178
AI assistance
This contribution was prepared with OpenAI Codex under the contributor's direction. The contributor reviewed and tested the changes and accepts responsibility for them.