You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
VB.NET: references to Shared fields/properties and class-qualified access are not resolved #2305
VB.NET files are parsed (nodes show up as vbnet), but member access through the class name (AppSession.SessionId) does not produce a reference edge for Shared fields and Shared properties. codegraph callers returns 0 for them, and also for the class itself. Shared methods are resolved correctly.
In a real project this hides hundreds of usages that plain text search finds immediately, and makes impact / blast-radius output misleading.
Environment
CodeGraph
1.6.1 (Windows, official installer)
Node
v26.10.0
OS
Windows 11 Enterprise 10.0.26100
Language
VB.NET (.NET Framework WinForms)
Setup
codegraph init, no codegraph.json extension mappings
SessionId and CurrentUser list Consumer.Run and Consumer2.Describe as referencing symbols.
AppSession lists the classes that reference it.
Actual
Only the method call produces an edge. Field and property reads/writes through the class name produce none, so callers, impact and the blast-radius section of codegraph_explore under-report dependencies.
Impact on a real codebase
In a ~2,000-file VB.NET WinForms solution, a central static session class (Public Class with Public Shared members) is referenced from ~460 files according to grep.
codegraph callers <ClassName> returns only 6 results (all from one C# file).
Thanks @serkanince for the report and the clear minimal repro.
The fix is on main in #2355, building on the approach in #2321 by @ChrisPrapas. VB.NET used to record only calls, so a read or write through a class name, like AppSession.SessionId or AppSession.CurrentUser = "demo", produced no reference at all. It now links both the member and the class. On your three files, codegraph callers SessionId, callers CurrentUser and callers AppSession all list Consumer.Run and Consumer2.Describe. Before, they returned 0.
The same now applies to:
Enum values like Mode.Fast
indexed Shared fields like AppSession.Items(0)
Shared functions named without parentheses, which count as calls. Under AddressOf or NameOf they stay plain references.
The name is resolved the way VB.NET scopes it, through namespaces and Imports, including aliases. A local, parameter or field that only shares the class's name, which VB.NET's case-insensitivity makes easy to hit, is not mistaken for the class. On two public WinForms projects, SCrawler and staxrip, this added about 2,500 and 5,900 correct links, and none were removed.
Not covered yet: reads through Me. or an instance variable (s.CurrentUser), and With blocks.
This ships in the next release. Re-index after upgrading (codegraph index) to pick it up. You and @ChrisPrapas are both credited in the changelog. If you get a chance to run it on your ~2,000-file solution, the before and after numbers would be welcome.
Activity
docs: add remediation plan; Phase 0 — release highlights and issue re…
Phase 4: resolution and extraction accuracy
fix(vbnet): link Shared fields and properties read through their class (
colbymchenry commentedon Oct 5, 2026
Thanks @serkanince for the report and the clear minimal repro.
The fix is on
mainin #2355, building on the approach in #2321 by @ChrisPrapas. VB.NET used to record only calls, so a read or write through a class name, likeAppSession.SessionIdorAppSession.CurrentUser = "demo", produced no reference at all. It now links both the member and the class. On your three files,codegraph callers SessionId,callers CurrentUserandcallers AppSessionall listConsumer.RunandConsumer2.Describe. Before, they returned 0.The same now applies to:
Enumvalues likeMode.FastSharedfields likeAppSession.Items(0)Sharedfunctions named without parentheses, which count as calls. UnderAddressOforNameOfthey stay plain references.The name is resolved the way VB.NET scopes it, through namespaces and
Imports, including aliases. A local, parameter or field that only shares the class's name, which VB.NET's case-insensitivity makes easy to hit, is not mistaken for the class. On two public WinForms projects, SCrawler and staxrip, this added about 2,500 and 5,900 correct links, and none were removed.Not covered yet: reads through
Me.or an instance variable (s.CurrentUser), andWithblocks.This ships in the next release. Re-index after upgrading (
codegraph index) to pick it up. You and @ChrisPrapas are both credited in the changelog. If you get a chance to run it on your ~2,000-file solution, the before and after numbers would be welcome.