Summary
cdidx symbols and cdidx definition accept --kind (function/class/etc.) but do not accept --visibility (public/internal/protected/private). Audit workflows like "list public API surface" or "find internal helpers that should be private" have to re-derive visibility from cdidx unused output (which prints [private]/[internal]/[public] markers).
The DB already stores s.visibility (e.g. used in src/CodeIndex/Database/DbReader.CSharpResolution.cs:923), so a --visibility filter is a one-line query-builder change.
Use cases
- "List the C# public surface of this assembly":
cdidx symbols --lang csharp --visibility public
- "Find internal helpers that should be made private":
cdidx symbols --lang csharp --visibility internal --max-references 3
- "Show all
private test helpers": cdidx symbols --lang csharp --visibility private --path tests/**
Proposed direction
Add a --visibility flag to symbols, definition, unused, and hotspots, with values public | protected | internal | private (multi-value comma-separated). Add a corresponding --exclude-visibility for negation. Reuse the same parsing as --kind.
Repro env
- Branch:
main @ 2ee912d (release v1.21.0)
Summary
cdidx symbolsandcdidx definitionaccept--kind(function/class/etc.) but do not accept--visibility(public/internal/protected/private). Audit workflows like "list public API surface" or "find internal helpers that should be private" have to re-derive visibility fromcdidx unusedoutput (which prints[private]/[internal]/[public]markers).The DB already stores
s.visibility(e.g. used insrc/CodeIndex/Database/DbReader.CSharpResolution.cs:923), so a--visibilityfilter is a one-line query-builder change.Use cases
cdidx symbols --lang csharp --visibility publiccdidx symbols --lang csharp --visibility internal --max-references 3privatetest helpers":cdidx symbols --lang csharp --visibility private --path tests/**Proposed direction
Add a
--visibilityflag tosymbols,definition,unused, andhotspots, with valuespublic | protected | internal | private(multi-value comma-separated). Add a corresponding--exclude-visibilityfor negation. Reuse the same parsing as--kind.Repro env
main@ 2ee912d (release v1.21.0)