JsonSyntaxHighlighter
Highlights JSON text: keys, strings, numbers, true, false, null, brackets and the section labels of a job view.
| Inherits | TokenizedHighlighter |
| Group | widgets |
Declared in src/libs/libwidgets/widgets/JsonSyntaxHighlighter.hpp.
Detailed description
A TokenizedHighlighter of syntax::Language::Json (log-color §LGC-D-10, parity row LGC-30). The colors come from the syntax colors of the current SemanticPalette. A key is a quoted string followed by a colon. A quoted string with no colon after it is a value. The labels Input:, Result: and Error: at the start of a line get the heading color, so a view that shows the input and the result of a job in one document can separate them.
Until 2026-10-18 the class ran six regular expressions one after the other. The tokenizer runs the same six rules in the same order, so each character keeps its format: a number, a constant or a bracket inside a string keeps its own color, as before. testSyntax holds the tokenizer to the old spans on a corpus.
See also YamlSyntaxHighlighter.