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
fix(web): multiline highlight ranges are broken / omitted in LightweightCodeHighlighter #1698
In LightweightCodeHighlighter.tsx, highlight ranges spanning multiple lines are not properly mapped across lines.
Currently, the component filters and maps ranges using:
// @todo: we will need to handle the case where a range spans multiple lines.constranges=highlightRanges?.filter(range=>{returnrange.start.lineNumber===lineNumber||range.end.lineNumber===lineNumber;}).map(range=>({from: range.start.column-1,to: range.end.column-1,}));
Consequences
Middle Lines Dropped: Any line between range.start.lineNumber and range.end.lineNumber fails the condition range.start.lineNumber === lineNumber || range.end.lineNumber === lineNumber, resulting in zero highlighting for intermediate lines.
Column Inversion on Start/End Lines:
Start Line:to is set to range.end.column - 1 (column from a different line). If start.column > end.column, from > to creates an invalid range.
End Line:from is set to range.start.column - 1 (start line's column), clipping or omitting matches.
Impacted Areas
This affects all views using LightweightCodeHighlighter:
Symbol Definition Previews (symbolDefinitionPreview.tsx): Multi-line types, interfaces, or function definitions have broken highlights in hover popovers.
Search Result Chunks (fileMatch.tsx): Multi-line regex matches from Zoekt render corrupted or blank intermediate highlights.
References List (referenceList.tsx): Multi-line call signatures and JSX nodes.
Expected Behavior
Highlight ranges spanning multiple lines should:
Start line: Highlight from start.column to line.length.
Intermediate lines: Highlight the entire line (0 to line.length).
Activity