Syntax highlighting improvements
- Langage dominant
- Dart
- Étoiles
- 1.7k
- Forks
- 404
- Merge moyen
- 6 j 17 h
- PR mergées (30 j)
- 18
Description
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)
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par SyntaxHighlighter et CodeView, les seuls consommateurs indiqués, puis examinez les tests du panneau de débogage mentionnés dans l’issue. Vérifiez le comportement lorsqu’aucune grammaire n’est disponible et mesurez que la coloration syntaxique et le retour à la ligne sont gérés en un seul parcours de la source, tout en continuant à faire passer les tests existants.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- dart
- Domaine
- devtools, performance
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100