Skip to content

Commit

Permalink
fix(nix): colors for paths, numbers, contants (#220)
Browse files Browse the repository at this point in the history
Turns out Nix language servers do semantic highlighting
  • Loading branch information
nekowinston authored Nov 27, 2023
1 parent 8b9b2a9 commit 235693b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/theme/semanticTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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" },
Expand Down
8 changes: 8 additions & 0 deletions src/theme/tokens/nix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ const tokens = (context: ThemeContext): TextmateColors => {
fontStyle: "",
},
},
{
name: "Nix paths",
scope: "string.unquoted.path.nix",
settings: {
foreground: palette.text,
fontStyle: "",
},
},
];
};

Expand Down

0 comments on commit 235693b

Please sign in to comment.