дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 03:05:40 +02:00
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]>
Цей коміт міститься в:
1 джерело
f4fa2b42f6
коміт
78a3768ec1
15 files changed
+297
-293
No files matched your search
@@ -4,6 +4,7 @@ import { create } from "zustand";
|
||||
import clsx from "clsx";
|
||||
import type { Diagnostic, Severity } from "@/bindings";
|
||||
import { useEditorRegistry } from "@/editor/api";
|
||||
import { previewColors } from "@/editor/lineTokens";
|
||||
import { executeAction } from "@/platform/actions";
|
||||
import { formatBinding, hasPrimaryModifier, hostBinding, shortcutLabel } from "@/platform/keymap";
|
||||
import { basename, relativeDir, useProject } from "@/platform/project";
|
||||
@@ -409,6 +410,7 @@ export function ProblemsView() {
|
||||
line={selected?.d.range.start.line ?? 0}
|
||||
highlights={selected ? [diagHighlight(selected.d)] : []}
|
||||
load={previewText}
|
||||
colorize={previewColors}
|
||||
/>
|
||||
</SplitPanel>
|
||||
</SplitGroup>
|
||||
|
||||
Reference in new issue
Заблокувати користувача