Summary
CodeLens reference counts currently cover only source files in the solution workspace. References inside external/NuGet/GAC assemblies referenced by the project are not counted.
Context
A TODO has been placed in CodeLensService.ComputeLensData() (after the workspace scan loop) marking the exact insertion point for this feature.
Proposed Approach
- For each project in the solution, resolve the list of referenced assembly paths (
<Reference>, <PackageReference>, project-to-project refs)
- For each assembly, decompile to C# skeleton text using
AssemblyAnalysisEngine + CSharpSkeletonEmitter (already available in WpfHexEditor.Core.AssemblyAnalysis)
- Feed the decompiled text into a per-assembly cache bucket within
WorkspaceFileCache, keyed by assembly identity (name + version + culture + public key token) to avoid re-decompiling on every lens refresh
- Run the same
CountWholeWordOccurrencesInText() scan on the decompiled lines and add to the count
Acceptance Criteria
CreateProviderWithData defined in project A shows +N references when called from an assembly B that references project A
- Cache is invalidated when the referenced assembly is rebuilt or replaced on disk
- Decompilation runs entirely on a background thread; no UI freeze
- Falls back gracefully (0 external refs) if decompilation fails
Related
Summary
CodeLens reference counts currently cover only source files in the solution workspace. References inside external/NuGet/GAC assemblies referenced by the project are not counted.
Context
A
TODOhas been placed inCodeLensService.ComputeLensData()(after the workspace scan loop) marking the exact insertion point for this feature.Proposed Approach
<Reference>,<PackageReference>, project-to-project refs)AssemblyAnalysisEngine+CSharpSkeletonEmitter(already available inWpfHexEditor.Core.AssemblyAnalysis)WorkspaceFileCache, keyed by assembly identity (name + version + culture + public key token) to avoid re-decompiling on every lens refreshCountWholeWordOccurrencesInText()scan on the decompiled lines and add to the countAcceptance Criteria
CreateProviderWithDatadefined in project A shows +N references when called from an assembly B that references project ARelated
Sources/WpfHexEditor.Editor.CodeEditor/Services/CodeLensService.cs— TODO at line ~190Sources/WpfHexEditor.Core.AssemblyAnalysis/— CSharpSkeletonEmitter + AssemblyAnalysisEngine