From 235693bc9ba9d1e05801e5a6954af1bb5accd659 Mon Sep 17 00:00:00 2001 From: nekowinston Date: Mon, 27 Nov 2023 15:10:51 +0100 Subject: [PATCH] fix(nix): colors for paths, numbers, contants (#220) Turns out Nix language servers do semantic highlighting --- src/theme/semanticTokens.ts | 5 +++++ src/theme/tokens/nix.ts | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/src/theme/semanticTokens.ts b/src/theme/semanticTokens.ts index 6ebbf59d..267c2457 100644 --- a/src/theme/semanticTokens.ts +++ b/src/theme/semanticTokens.ts @@ -6,6 +6,8 @@ export const getSemanticTokens = (context: ThemeContext): SemanticTokens => { return { enumMember: { foreground: palette.teal }, selfKeyword: { foreground: palette.red }, + boolean: { foreground: palette.peach }, + number: { foreground: palette.peach }, "variable.defaultLibrary": { foreground: palette.maroon }, // Python types @@ -40,6 +42,9 @@ export const getSemanticTokens = (context: ThemeContext): SemanticTokens => { "builtinAttribute.attribute.library:rust": { foreground: palette.blue }, "generic.attribute:rust": { foreground: palette.text }, + // Nix + "constant.builtin.readonly:nix": { foreground: palette.mauve }, + // Typst heading: { foreground: palette.red }, "text.emph": { foreground: palette.red, fontStyle: "italic" }, diff --git a/src/theme/tokens/nix.ts b/src/theme/tokens/nix.ts index d154aae1..43676da8 100644 --- a/src/theme/tokens/nix.ts +++ b/src/theme/tokens/nix.ts @@ -30,6 +30,14 @@ const tokens = (context: ThemeContext): TextmateColors => { fontStyle: "", }, }, + { + name: "Nix paths", + scope: "string.unquoted.path.nix", + settings: { + foreground: palette.text, + fontStyle: "", + }, + }, ]; };