Syntax highlighting improvements
Open
Nobody has claimed this yet.
P2
screen: debugger
- Dominant language
- Dart
- Stars
- 1.7k
- Forks
- 404
- Avg merge
- 6d 17h
- Merged PRs (30d)
- 18
Description
A couple things I noticed while updating some debugger panel tests:
- If there is no
grammar, theSyntaxHighlighterreturns aTextSpanwith no children. This is a problem because inCodeView(the only place where ourSyntaxHighlighteris used, we expect theTextSpanto 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. - 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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with SyntaxHighlighter and CodeView, the only stated consumer, then inspect the debugger panel tests mentioned in the issue. Verify behavior when no grammar is available and measure that syntax highlighting and line breaking are handled in one source pass, with the existing tests still passing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart
- Domain
- devtools, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100