mirror of https://github.com/helix-editor/helix
Merge branch 'helix-editor:master' into pull-diagnostics
commit
b72ccfde7c
@ -0,0 +1,142 @@
|
||||
; identifiers
|
||||
; -----------
|
||||
(identifier) @variable
|
||||
|
||||
; Pragma
|
||||
; -----------
|
||||
(pragma_directive) @keyword.directive
|
||||
|
||||
; Include
|
||||
; -----------
|
||||
(include_directive) @keyword.directive
|
||||
|
||||
; Literals
|
||||
; --------
|
||||
(string) @string
|
||||
(int_literal) @constant.numeric.integer
|
||||
(comment) @comment
|
||||
|
||||
; Definitions
|
||||
; -----------
|
||||
(function_definition
|
||||
name: (identifier) @keyword.function)
|
||||
|
||||
(template_definition
|
||||
name: (identifier) @keyword.function)
|
||||
|
||||
; Use contructor coloring for special functions
|
||||
(main_component_definition) @constructor
|
||||
|
||||
; Invocations
|
||||
(call_expression . (identifier) @function)
|
||||
|
||||
; Function parameters
|
||||
(parameter name: (identifier) @variable.parameter)
|
||||
|
||||
; Members
|
||||
(member_expression property: (property_identifier) @variable.other.member)
|
||||
|
||||
; Tokens
|
||||
; -------
|
||||
|
||||
; Keywords
|
||||
[
|
||||
"signal"
|
||||
"var"
|
||||
"component"
|
||||
] @keyword.storage.type
|
||||
|
||||
[ "include" ] @keyword.control.import
|
||||
|
||||
[
|
||||
"public"
|
||||
"input"
|
||||
"output"
|
||||
] @keyword.storage.modifier
|
||||
|
||||
[
|
||||
"for"
|
||||
"while"
|
||||
] @keyword.control.repeat
|
||||
|
||||
[
|
||||
"if"
|
||||
"else"
|
||||
] @keyword.control.conditional
|
||||
|
||||
[
|
||||
"return"
|
||||
] @keyword.control.return
|
||||
|
||||
[
|
||||
"function"
|
||||
"template"
|
||||
] @keyword.function
|
||||
|
||||
; Punctuation
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
"."
|
||||
","
|
||||
";"
|
||||
] @punctuation.delimiter
|
||||
|
||||
; Operators
|
||||
; https://docs.circom.io/circom-language/basic-operators
|
||||
[
|
||||
"="
|
||||
"?"
|
||||
"&&"
|
||||
"||"
|
||||
"!"
|
||||
"<"
|
||||
">"
|
||||
"<="
|
||||
">="
|
||||
"=="
|
||||
"!="
|
||||
"+"
|
||||
"-"
|
||||
"*"
|
||||
"**"
|
||||
"/"
|
||||
"\\"
|
||||
"%"
|
||||
"+="
|
||||
"-="
|
||||
"*="
|
||||
"**="
|
||||
"/="
|
||||
"\\="
|
||||
"%="
|
||||
"++"
|
||||
"--"
|
||||
"&"
|
||||
"|"
|
||||
"~"
|
||||
"^"
|
||||
">>"
|
||||
"<<"
|
||||
"&="
|
||||
"|="
|
||||
; "\~=" ; bug, uncomment and circom will not highlight
|
||||
"^="
|
||||
">>="
|
||||
"<<="
|
||||
] @operator
|
||||
|
||||
[
|
||||
"<=="
|
||||
"==>"
|
||||
"<--"
|
||||
"-->"
|
||||
"==="
|
||||
] @operator
|
@ -0,0 +1,9 @@
|
||||
(function_definition) @local.scope
|
||||
(template_definition) @local.scope
|
||||
(main_component_definition) @local.scope
|
||||
(block_statement) @local.scope
|
||||
|
||||
(parameter name: (identifier) @local.definition) @local.definition
|
||||
|
||||
|
||||
(identifier) @local.reference
|
@ -1,119 +1,124 @@
|
||||
# Author : Timothy DeHerrera <tim@nrdxp.dev>
|
||||
"comment".fg = "comment"
|
||||
|
||||
"constant".fg = "purple"
|
||||
"constant.builtin".fg = "olive"
|
||||
"constant.character".fg = "carnation"
|
||||
"constant.builtin".fg = "olive"
|
||||
"constant.character.escape".fg = "magenta"
|
||||
"constant.numeric".fg = "cyan"
|
||||
"constant.numeric.float".fg = "red"
|
||||
"constant.character".fg = "carnation"
|
||||
"constant".fg = "purple"
|
||||
"constant.numeric".fg = "cyan"
|
||||
"constant.numeric.float".fg = "red"
|
||||
|
||||
"function".fg = "green"
|
||||
"function.builtin".fg = "sand"
|
||||
"function.macro".fg = "blue"
|
||||
"function.method".fg = "opal"
|
||||
"function".fg = "green"
|
||||
"function.macro".fg = "blue"
|
||||
"function.method".fg = "opal"
|
||||
|
||||
"keyword" = { fg = "magenta", modifiers = ["bold"] }
|
||||
"keyword.operator" = { fg = "coral", modifiers = ["bold"] }
|
||||
"keyword.function" = { fg = "lilac", modifiers = ["bold"] }
|
||||
"keyword.control" = { fg = "carnation", modifiers = ["bold"]}
|
||||
"keyword" = { fg = "magenta", modifiers = ["bold"] }
|
||||
"keyword.control" = { fg = "carnation", modifiers = ["bold"] }
|
||||
"keyword.control.exception" = { fg = "red", modifiers = ["bold"] }
|
||||
"keyword.storage" = { fg = "coral", modifiers = ["bold"] }
|
||||
"keyword.function" = { fg = "lilac", modifiers = ["bold"] }
|
||||
"keyword.operator" = { fg = "coral", modifiers = ["bold"] }
|
||||
"keyword.storage" = { fg = "coral", modifiers = ["bold"] }
|
||||
|
||||
"operator".fg = "coral"
|
||||
|
||||
"punctuation".fg = "magenta"
|
||||
"punctuation.bracket".fg = "foreground"
|
||||
"punctuation.delimiter".fg = "coral"
|
||||
"punctuation.bracket".fg = "foreground"
|
||||
"punctuation".fg = "magenta"
|
||||
|
||||
"string".fg = "yellow"
|
||||
"attribute".fg = "opal"
|
||||
"string".fg = "yellow"
|
||||
"string.regexp".fg = "red"
|
||||
"string.special".fg = "blue"
|
||||
"string.regexp".fg = "red"
|
||||
"tag".fg = "carnation"
|
||||
"attribute".fg = "opal"
|
||||
"tag".fg = "carnation"
|
||||
|
||||
"type".fg = "opal"
|
||||
"type.variant".fg = "sand"
|
||||
"type.builtin".fg = "yellow"
|
||||
"type.builtin".fg = "yellow"
|
||||
"type.enum.variant".fg = "sand"
|
||||
"type".fg = "opal"
|
||||
"type.variant".fg = "sand"
|
||||
|
||||
"variable".fg = "cyan"
|
||||
"variable.builtin".fg = "olive"
|
||||
"variable.builtin".fg = "olive"
|
||||
"variable".fg = "cyan"
|
||||
"variable.other.member".fg = "lilac"
|
||||
"variable.parameter" = { fg ="blue", modifiers = ["italic"] }
|
||||
"variable.parameter" = { fg = "blue", modifiers = ["italic"] }
|
||||
|
||||
"namespace".fg = "olive"
|
||||
"constructor".fg = "sand"
|
||||
"special".fg = "magenta"
|
||||
"label".fg = "magenta"
|
||||
"label".fg = "magenta"
|
||||
"namespace".fg = "olive"
|
||||
"special".fg = "magenta"
|
||||
|
||||
"diff.plus".fg = "green"
|
||||
"diff.delta".fg = "blue"
|
||||
"diff.minus".fg = "red"
|
||||
|
||||
"ui.background" = { fg = "foreground", bg = "background" }
|
||||
"ui.cursor" = { fg = "background", bg = "blue", modifiers = ["dim"] }
|
||||
"ui.cursor.match" = { fg = "green", modifiers = ["underlined"] }
|
||||
"ui.cursor.primary" = { fg = "background", bg = "cyan", modifiers = ["dim"] }
|
||||
"ui.help" = { fg = "foreground", bg = "background_dark" }
|
||||
"ui.linenr" = { fg = "comment" }
|
||||
"ui.linenr.selected" = { fg = "foreground" }
|
||||
"ui.menu" = { fg = "foreground", bg = "background_dark" }
|
||||
"ui.menu.selected" = { fg = "cyan", bg = "background_dark" }
|
||||
"ui.popup" = { fg = "foreground", bg = "background_dark" }
|
||||
"ui.selection" = { bg = "secondary_highlight" }
|
||||
"ui.selection.primary" = { bg = "primary_highlight" }
|
||||
"ui.cursorline" = { bg = "background_dark" }
|
||||
"ui.statusline" = { fg = "foreground", bg = "background_dark" }
|
||||
"ui.statusline.inactive" = { fg = "comment", bg = "background_dark" }
|
||||
"ui.statusline.insert" = { fg = "olive", bg = "background_dark" }
|
||||
"ui.statusline.normal" = { fg = "opal", bg = "background_dark" }
|
||||
"ui.statusline.select" = { fg = "carnation", bg = "background_dark" }
|
||||
"ui.text" = { fg = "foreground" }
|
||||
"ui.text.focus" = { fg = "cyan" }
|
||||
"ui.window" = { fg = "foreground" }
|
||||
"ui.virtual.whitespace" = { fg = "comment" }
|
||||
"diff.plus".fg = "green"
|
||||
|
||||
"ui.background" = { fg = "foreground", bg = "background" }
|
||||
"ui.cursor" = { fg = "background", bg = "blue", modifiers = ["dim"] }
|
||||
"ui.cursor.match" = { fg = "green", modifiers = ["underlined"] }
|
||||
"ui.cursor.primary" = { fg = "background", bg = "cyan", modifiers = ["dim"] }
|
||||
"ui.cursorline" = { bg = "background_dark" }
|
||||
"ui.help" = { fg = "foreground", bg = "background_dark" }
|
||||
"ui.linenr" = { fg = "comment" }
|
||||
"ui.linenr.selected" = { fg = "foreground" }
|
||||
"ui.menu" = { fg = "foreground", bg = "background_dark" }
|
||||
"ui.menu.selected" = { fg = "cyan", bg = "background_dark" }
|
||||
"ui.popup" = { fg = "foreground", bg = "background_dark" }
|
||||
"ui.selection" = { bg = "secondary_highlight" }
|
||||
"ui.selection.primary" = { bg = "primary_highlight" }
|
||||
"ui.statusline" = { fg = "foreground", bg = "background_dark" }
|
||||
"ui.statusline.inactive" = { fg = "comment", bg = "background_dark" }
|
||||
"ui.statusline.insert" = { fg = "olive", bg = "background_dark" }
|
||||
"ui.statusline.normal" = { fg = "opal", bg = "background_dark" }
|
||||
"ui.statusline.select" = { fg = "carnation", bg = "background_dark" }
|
||||
"ui.text" = { fg = "foreground" }
|
||||
"ui.text.focus" = { fg = "cyan" }
|
||||
"ui.virtual.indent-guide" = { fg = "opal" }
|
||||
"ui.virtual.ruler" = { bg = "background_dark" }
|
||||
"ui.virtual.ruler" = { bg = "background_dark" }
|
||||
"ui.virtual.whitespace" = { fg = "comment" }
|
||||
"ui.window" = { fg = "foreground" }
|
||||
|
||||
"error" = { fg = "red" }
|
||||
"error" = { fg = "red" }
|
||||
"warning" = { fg = "cyan" }
|
||||
|
||||
"diagnostic" = { underline = { style = "line", color = "coral" }, bg = "cyan" }
|
||||
"diagnostic.deprecated" = { modifiers = ["crossed_out"] }
|
||||
"diagnostic.error" = { underline = { style = "curl", color = "red" } }
|
||||
"diagnostic.hint" = { underline = { style = "line", color = "cyan" } }
|
||||
"diagnostic.info" = { underline = { style = "line" } }
|
||||
"diagnostic.unnecessary" = { modifiers = ["dim"] }
|
||||
"diagnostic.deprecated" = { modifiers = ["crossed_out"] }
|
||||
|
||||
"markup.heading" = { fg = "purple", modifiers = ["bold"] }
|
||||
"markup.link.label" = { fg = "blue", modifiers = ["italic"] }
|
||||
"markup.list" = "cyan"
|
||||
"markup.bold" = { fg = "blue", modifiers = ["bold"] }
|
||||
"markup.italic" = { fg = "yellow", modifiers = ["italic"] }
|
||||
"diagnostic.warning" = { underline = { style = "curl", color = "yellow" } }
|
||||
|
||||
"markup.bold" = { fg = "blue", modifiers = ["bold"] }
|
||||
"markup.heading" = { fg = "purple", modifiers = ["bold"] }
|
||||
"markup.italic" = { fg = "yellow", modifiers = ["italic"] }
|
||||
"markup.link.label" = { fg = "blue", modifiers = ["italic"] }
|
||||
"markup.link.text" = "magenta"
|
||||
"markup.link.url" = "cyan"
|
||||
"markup.list" = "cyan"
|
||||
"markup.quote" = { fg = "yellow", modifiers = ["italic"] }
|
||||
"markup.raw" = { fg = "foreground" }
|
||||
"markup.strikethrough" = { modifiers = ["crossed_out"] }
|
||||
"markup.link.url" = "cyan"
|
||||
"markup.link.text" = "magenta"
|
||||
"markup.quote" = { fg = "yellow", modifiers = ["italic"] }
|
||||
"markup.raw" = { fg = "foreground" }
|
||||
|
||||
[palette]
|
||||
background = "#282a36"
|
||||
background_dark = "#21222c"
|
||||
primary_highlight = "#800049"
|
||||
background = "#282a36"
|
||||
background_dark = "#21222c"
|
||||
comment = "#a39e9b"
|
||||
foreground = "#eff0eb"
|
||||
primary_highlight = "#800049"
|
||||
secondary_highlight = "#4d4f66"
|
||||
foreground = "#eff0eb"
|
||||
comment = "#a39e9b"
|
||||
|
||||
# main colors
|
||||
red = "#ff5c57"
|
||||
blue = "#57c7ff"
|
||||
yellow = "#f3f99d"
|
||||
green = "#5af78e"
|
||||
purple = "#bd93f9"
|
||||
cyan = "#9aedfe"
|
||||
blue = "#57c7ff"
|
||||
cyan = "#9aedfe"
|
||||
green = "#5af78e"
|
||||
magenta = "#ff6ac1"
|
||||
purple = "#bd93f9"
|
||||
red = "#ff5c57"
|
||||
yellow = "#f3f99d"
|
||||
|
||||
# aux colors
|
||||
lilac = "#c9c5fb"
|
||||
coral = "#f97c7c"
|
||||
sand = "#ffab6f"
|
||||
carnation = "#f99fc6"
|
||||
olive = "#b6d37c"
|
||||
opal = "#b1d7c7"
|
||||
coral = "#f97c7c"
|
||||
lilac = "#c9c5fb"
|
||||
olive = "#b6d37c"
|
||||
opal = "#b1d7c7"
|
||||
sand = "#ffab6f"
|
||||
|
@ -0,0 +1,33 @@
|
||||
use helix_view::theme::Loader;
|
||||
|
||||
use crate::{path, DynError};
|
||||
|
||||
pub fn theme_check() -> Result<(), DynError> {
|
||||
let theme_names = [
|
||||
vec!["default".to_string(), "base16_default".to_string()],
|
||||
Loader::read_names(&path::themes()),
|
||||
]
|
||||
.concat();
|
||||
let loader = Loader::new(&[path::runtime()]);
|
||||
let mut errors_present = false;
|
||||
|
||||
for name in theme_names {
|
||||
let (_, warnings) = loader.load_with_warnings(&name).unwrap();
|
||||
|
||||
if !warnings.is_empty() {
|
||||
errors_present = true;
|
||||
println!("Theme '{name}' loaded with errors:");
|
||||
for warning in warnings {
|
||||
println!("\t* {}", warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
match errors_present {
|
||||
true => Err("Errors found when loading bundled themes".into()),
|
||||
false => {
|
||||
println!("Theme check successful!");
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue