Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

fix(web): multiline highlight ranges are broken / omitted in LightweightCodeHighlighter

オープン 初心者向け
#1,698 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@riteshvish02 がすでに取り組んでいます。

2026年9月30日 から。

  • #1699 @riteshvish02 による — オープン

評価

難易度
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
  1. 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.
  2. 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).
  • End line: Highlight from 0 to end.column.

主要言語
TypeScript
スター
3.9k
フォーク
374
平均マージ
17時間 15分
マージ済み PR(30日)
38

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

sourcebot-dev/sourcebot のほかの issue

sourcebot-dev/sourcebot の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。