fix(web): multiline highlight ranges are broken / omitted in LightweightCodeHighlighter
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- frontend
Línea de trabajo
Comienza en LightweightCodeHighlighter.tsx e inspecciona cómo se filtran y mapean los highlightRanges para cada línea. Verifica los usos relacionados en symbolDefinitionPreview.tsx, fileMatch.tsx y referenceList.tsx. Se considera terminado cuando las líneas iniciales usan la columna inicial hasta line.length, las líneas intermedias resaltan desde 0 hasta line.length y las líneas finales usan 0 hasta la columna final.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.9k
- Forks
- 374
- Merge medio
- 17 h 15 min
- PR fusionados (30 d)
- 38
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de sourcebot-dev/sourcebot
-
bug(web): Intermediate directory nodes in buildFileTree receive child leaf paths instead of directory pathsPosiblemente ocupada @riteshvish02 la tomó hace 4 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
sourcebot-dev/sourcebot#1707 ·
Los mantenedores suelen responder en 1 día
-
[bug] Search result hydration performs duplicate repository lookups within the same chunkPosiblemente ocupada @dipeshbabu la tomó hace 14 días. Abiertobug triage needed
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
sourcebot-dev/sourcebot#1681 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Linux ctags build instructions in CONTRIBUTING.md are missing build dependenciesPosiblemente ocupada @The-AarushiSingh la tomó hace 20 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
sourcebot-dev/sourcebot#1633 ·
Los mantenedores suelen responder en 1 día
-
Generic Git URL configs keep percent-encoded repo namesPosiblemente ocupada @Tyagiquamar la tomó hace 20 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
sourcebot-dev/sourcebot#1384 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
MCP ask_codebase rejects explicit languageModel: getLanguageModelKey includes displayName which the MCP schema doesn't exposePosiblemente ocupada @pranav718 la tomó hace 37 días. Abiertoask_sb bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
sourcebot-dev/sourcebot#1137 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de sourcebot-dev/sourcebot
Issues similares
-
Bump Firebase JS SDK (12.19.0 → 13.0.0)Posiblemente ocupada @SelaseKay la tomó hoy. AbiertoNeeds Attention type: enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
invertase/react-native-firebase#9364 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 4 días
-
[fullsend] E2E: rhdh-version-override — run-e2e.sh overrides RHDH_VERSION to non-existent 2.1Abiertoe2e-failure ready-to-code
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
redhat-developer/rhdh-plugin-export-overlays#4261 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug] 官网文档的图片挂了Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
area:cli bug triage:in-progress
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día