flutter / flutter/devtools

Syntax highlighting improvements

Abierto
#5,821 2 comentarios 0 reacciones 0 asignados Ver en GitHub
P2 screen: debugger
Lenguaje dominante
Dart
Estrellas
1.7k
Forks
404
Merge medio
6 d 17 h
PR fusionados (30 d)
18

Descripción

A couple things I noticed while updating some debugger panel tests:

1. If there is no `grammar`, the `SyntaxHighlighter` returns a `TextSpan` with no children. This is a problem because in `CodeView` (the only place where our `SyntaxHighlighter` is used, we expect the `TextSpan` to have children, and we loop through the children to break the span into lines. Therefore, if there is no grammar, we display the entire script on a single line.
2. We loop through the entire source twice. Once to add the syntax highlighting, and then again to break it into lines. We could see some performance improvements if we do both in one step (see https://github.com/flutter/devtools/issues/5703)

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.