fix(web): multiline highlight ranges are broken / omitted in LightweightCodeHighlighter
維護者通常 1 天內回覆
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 82/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- typescript
- 領域
- frontend
研究方向
從 LightweightCodeHighlighter.tsx 開始,檢查針對每一行如何篩選及映射 highlightRanges。確認 symbolDefinitionPreview.tsx、fileMatch.tsx 及 referenceList.tsx 中相關的使用方式。完成的標準是:起始行使用從起始欄到 line.length 的範圍,中間行從 0 高亮到 line.length,結束行使用從 0 到結束欄的範圍。
由索引模型根據 Issue 內容生成。
描述
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.
const ranges = highlightRanges?.filter(range => {
return range.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.lineNumberandrange.end.lineNumberfails the conditionrange.start.lineNumber === lineNumber || range.end.lineNumber === lineNumber, resulting in zero highlighting for intermediate lines. - Column Inversion on Start/End Lines:
- Start Line:
tois set torange.end.column - 1(column from a different line). Ifstart.column > end.column,from > tocreates an invalid range. - End Line:
fromis set torange.start.column - 1(start line's column), clipping or omitting matches.
- Start Line:
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.columntoline.length. - Intermediate lines: Highlight the entire line (
0toline.length). - End line: Highlight from
0toend.column.
- 主要語言
- TypeScript
- 星號
- 3.9k
- 分支
- 374
- 平均合併
- 2 天 13 小時
- 30 天內合併 PR
- 48
環境準備
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
sourcebot-dev/sourcebot 的其他 Issue
-
[bug] Search result hydration performs duplicate repository lookups within the same chunk可能已有人在做 @dipeshbabu 於 16 天前認領。 未關閉bug triage needed
難度 2/5 1-3 小時 新手友好度 84/100
sourcebot-dev/sourcebot#1681 · 1 則留言 ·
維護者通常 1 天內回覆
-
Linux ctags build instructions in CONTRIBUTING.md are missing build dependencies可能已有人在做 @The-AarushiSingh 於 22 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 84/100
sourcebot-dev/sourcebot#1633 ·
維護者通常 1 天內回覆
-
MCP ask_codebase rejects explicit languageModel: getLanguageModelKey includes displayName which the MCP schema doesn't expose可能已有人在做 @pranav718 於 39 天前認領。 未關閉ask_sb bug
難度 2/5 1-3 小時 新手友好度 76/100
sourcebot-dev/sourcebot#1137 · 4 則留言 ·
維護者通常 1 天內回覆
-
[FR] Support file-based and Azure Key Vault token sources alongside env and googleCloudSecret可能重新可做 關聯的 PR 已關閉且未合併。 未關閉
難度 4/5 3-5 天 新手友好度 64/100
sourcebot-dev/sourcebot#1704 · 1 則留言 ·
維護者通常 1 天內回覆
-
[bug] Local repositories with a space or non-ASCII character in the path cannot be indexed可能已有人在做 @breken-ai 於 13 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 35/100
sourcebot-dev/sourcebot#1689 ·
維護者通常 1 天內回覆
查看 sourcebot-dev/sourcebot 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 1 天內回覆
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:other issue-rating: 🦞 diamond lobster no-stale P2
難度 2/5 1-3 小時 新手友好度 72/100
openclaw/openclaw#168089 · 2 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
-
✨ enhancement needs-discussion
難度 1/5 1 小時以內 新手友好度 85/100
-
[Bug]: [MCP/CLI] Bare loopback IP addresses (127.0.0.1:port) and hosts with ports fail to navigate due to erroneous scheme inference可能已有人在做 @alok-108 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
microsoft/playwright#43263 ·
維護者通常 1 天內回覆
-
area:studio type:security
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆