feat(ui): syntax-highlight the read-only source previews (#1284)

The read-only previews beside Problems, Show Usages and TODO results are syntax-coloured from one whole-file parse (capped for very large files), so a line inside a block comment or a multi-line string is coloured as such; the pane renders plain first and recolours when the parse lands. SourcePreview takes the colouring as a colorize prop (the editor's previewColors), keeping src/ui free of editor imports, and the tok-* colours live once in global.css instead of a copy per view, with the theme's comment style.

Co-authored-by: qtvbwfn <[email protected]>
Цей коміт міститься в:
Qingтаqtvbwfn authored and GitHub committed 2026-11-05 00:55:03 +08:00
1 джерело f4fa2b42f6
коміт 78a3768ec1
15 files changed
+297 -293

No files matched your search

-38
Переглянути файл
@@ -307,44 +307,6 @@
text-decoration: underline;
}
/* Lezer classHighlighter tokens in fenced code (same colours as the Markdown preview). */
.markdown :global(.tok-keyword),
.markdown :global(.tok-modifier),
.markdown :global(.tok-controlKeyword),
.markdown :global(.tok-operatorKeyword) {
color: var(--syn-keyword);
}
.markdown :global(.tok-string),
.markdown :global(.tok-string2) {
color: var(--syn-string);
}
.markdown :global(.tok-number),
.markdown :global(.tok-bool),
.markdown :global(.tok-atom) {
color: var(--syn-number);
}
.markdown :global(.tok-typeName),
.markdown :global(.tok-className),
.markdown :global(.tok-namespace) {
color: var(--syn-type);
}
.markdown :global(.tok-comment) {
color: var(--syn-comment);
}
.markdown :global(.tok-meta),
.markdown :global(.tok-macroName) {
color: var(--syn-annotation);
}
.markdown :global(.tok-propertyName) {
color: var(--syn-property);
}
.markdown :global(.tok-variableName.tok-definition) {
color: var(--syn-function);
}
.markdown :global(.tok-punctuation),
.markdown :global(.tok-operator) {
color: var(--syn-punct);
}
.markdown :global(ul),
.markdown :global(ol) {
margin: 0 0 8px;