|
6 | 6 | syntaxHighlighting,
|
7 | 7 | StreamLanguage,
|
8 | 8 | } from "@codemirror/language";
|
| 9 | +import { EditorView } from "@codemirror/view"; |
9 | 10 | import { tags } from "@lezer/highlight";
|
10 | 11 |
|
11 | 12 | const redisCommands = [
|
@@ -71,30 +72,38 @@ const redisHighlightStyle = HighlightStyle.define([
|
71 | 72 | // Commands or keywords
|
72 | 73 | {
|
73 | 74 | tag: tags.keyword,
|
74 |
| - color: "#B76BE2", |
| 75 | + color: "#F28100", |
75 | 76 | //fontWeight: "bold",
|
76 | 77 | },
|
77 | 78 |
|
78 | 79 | // Variables and identifiers
|
79 |
| - { tag: tags.variableName, color: "#1A5FB4" }, |
| 80 | + { tag: tags.variableName, color: "#8F2EC4" }, |
80 | 81 |
|
81 | 82 | // Numbers
|
82 |
| - { tag: tags.number, color: "#26A269" }, |
| 83 | + { tag: tags.number, color: "#1750EB" }, |
83 | 84 |
|
84 | 85 | // JSON paths ($.productId)
|
85 |
| - { tag: tags.propertyName, color: "#C64600" }, |
| 86 | + { tag: tags.propertyName, color: "#FF16B4" }, |
86 | 87 |
|
87 | 88 | // Strings (quoted values)
|
88 |
| - { tag: tags.string, color: "#EB352A" }, |
| 89 | + { tag: tags.string, color: "#018800" }, |
89 | 90 |
|
90 | 91 | // Brackets and delimiters
|
91 |
| - { tag: tags.bracket, color: "#5E5C64" }, |
| 92 | + { tag: tags.bracket, color: "#091A23" }, |
92 | 93 |
|
93 | 94 | // Comments
|
94 | 95 | { tag: tags.comment, color: "#939598" },
|
95 | 96 | ]);
|
96 | 97 |
|
| 98 | +// Add selection theme configuration |
| 99 | +const selectionTheme = EditorView.theme({ |
| 100 | + "&.cm-focused .cm-selectionBackground, .cm-selectionBackground": { |
| 101 | + backgroundColor: "#E9E9E9 !important", |
| 102 | + }, |
| 103 | +}); |
| 104 | + |
97 | 105 | // Language support with highlighting
|
98 | 106 | export const redisSyntaxSupport = new LanguageSupport(redisLanguage, [
|
99 | 107 | syntaxHighlighting(redisHighlightStyle),
|
| 108 | + selectionTheme, |
100 | 109 | ]);
|
0 commit comments