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
Document outline drops child variables when a function/filter reuses a variable name declared earlier (scope-blind declaration dedup) #2282
changed the title [-]Filter is not treated the same as function in the outline view, child items do not expand[/-][+]Document outline drops child variables when a function/filter reuses a variable name declared earlier (scope-blind declaration dedup)[/+]on Jun 16, 2026
Investigated: this isn't specific to filter. The document-outline pipeline already treats filters like functions (SymbolVisitor → SymbolType.Function/SymbolKind.Function; VisitorUtils already special-cases IsFilter for the display name). The real cause is that ReferenceTable.AddReference dedupes variable declarations by name across the whole file, scope-blind (intentional per the inline comment, to clean up the outline). So the second function/filter to declare an already-seen variable name (e.g. $response) loses its declaration and therefore its outline chevron — reproducible with two plain functions, no filter required. A proper fix would scope the declaration-dedup to the containing function/filter, which changes deliberate behavior and warrants its own design + tests.
Activity
[-]Filter is not treated the same as function in the outline view, child items do not expand[/-][+]Document outline drops child variables when a function/filter reuses a variable name declared earlier (scope-blind declaration dedup)[/+]andyleejordan commentedon Jun 16, 2026
Investigated: this isn't specific to
filter. The document-outline pipeline already treats filters like functions (SymbolVisitor→SymbolType.Function/SymbolKind.Function;VisitorUtilsalready special-casesIsFilterfor the display name). The real cause is thatReferenceTable.AddReferencededupes variable declarations by name across the whole file, scope-blind (intentional per the inline comment, to clean up the outline). So the second function/filter to declare an already-seen variable name (e.g.$response) loses its declaration and therefore its outline chevron — reproducible with two plain functions, no filter required. A proper fix would scope the declaration-dedup to the containing function/filter, which changes deliberate behavior and warrants its own design + tests.Drafted by GitHub Copilot (Claude Opus 4.8) at Andy Jordan (@andyleejordan)'s request.