on master help sign in
Merge branch 'master' into cursor-shape-new
commitb3b4e78585d6a458954b8cb5b2c2a271a78b730b authorGokul Soumya <gokulps15@gmail.com> dateSun 9 Jan 2022, 10:38 (5 years ago) parent449624997e12f5
19 files changed+482−114
.gitmodules+9−1 book/src/configuration.md+1−1 book/src/generated/lang-support.md+3−1 book/src/themes.md+9−7 helix-core/src/object.rs+1−1 helix-syntax/build.rs−1 helix-syntax/languages/tree-sitter-haskell+1−1 helix-syntax/languages/tree-sitter-make+1 helix-syntax/languages/tree-sitter-regex+1 helix-term/src/config.rs+28−23 helix-view/src/theme.rs+45−40 languages.toml+15 runtime/queries/elixir/injections.scm+7 runtime/queries/haskell/highlights.scm+118−38 runtime/queries/make/highlights.scm+170 runtime/queries/markdown/highlights.scm+5 runtime/queries/regex/highlights.scm+53 runtime/queries/rust/injections.scm+14 theme.toml+1
.gitmodules+9−1
@@ -177,7 +177,7 @@
177177[submodule "helix-syntax/languages/tree-sitter-llvm-mir"]
178178 path = helix-syntax/languages/tree-sitter-llvm-mir
179179 url = https://github.com/Flakebi/tree-sitter-llvm-mir.git
180− shallow = true
180+ shallow = true
181181[submodule "helix-syntax/languages/tree-sitter-git-diff"]
182182 path = helix-syntax/languages/tree-sitter-git-diff
183183 url = https://github.com/the-mikedavis/tree-sitter-git-diff.git
@@ -190,3 +190,11 @@
190190 path = helix-syntax/languages/tree-sitter-git-rebase
191191 url = https://github.com/the-mikedavis/tree-sitter-git-rebase.git
192192 shallow = true
193+[submodule "helix-syntax/languages/tree-sitter-regex"]
194+ path = helix-syntax/languages/tree-sitter-regex
195+ url = https://github.com/tree-sitter/tree-sitter-regex.git
196+ shallow = true
197+[submodule "helix-syntax/languages/tree-sitter-make"]
198+ path = helix-syntax/languages/tree-sitter-make
199+ url = https://github.com/alemuller/tree-sitter-make
200+ shallow = true
book/src/configuration.md+1−1
@@ -58,7 +58,7 @@ of the terminal environment, only the primary cursor can change shape.
5858[insert mode]: ./keymap.md#insert-mode
5959[select mode]: ./keymap.md#select--extend-mode
6060
61−### `[editor.filepicker]` Section
61+### `[editor.file-picker]` Section
6262
6363Sets options for file picker and global search. All but the last key listed in
6464the default file-picker configuration below are IgnoreOptions: whether hidden
book/src/generated/lang-support.md+3−1
@@ -18,7 +18,7 @@
1818| go | ✓ | ✓ | ✓ | `gopls` |
1919| html | ✓ | | | |
2020| java | ✓ | | | |
21−| javascript | ✓ | | ✓ | |
21+| javascript | ✓ | | ✓ | `typescript-language-server` |
2222| json | ✓ | | ✓ | |
2323| julia | ✓ | | | `julia` |
2424| latex | ✓ | | | |
@@ -27,6 +27,7 @@
2727| llvm-mir | ✓ | ✓ | ✓ | |
2828| llvm-mir-yaml | ✓ | | ✓ | |
2929| lua | ✓ | | ✓ | |
30+| make | ✓ | | | |
3031| markdown | ✓ | | | |
3132| mint | | | | `mint` |
3233| nix | ✓ | | ✓ | `rnix-lsp` |
@@ -38,6 +39,7 @@
3839| protobuf | ✓ | | ✓ | |
3940| python | ✓ | ✓ | ✓ | `pylsp` |
4041| racket | | | | `racket` |
42+| regex | ✓ | | | |
4143| ruby | ✓ | | ✓ | `solargraph` |
4244| rust | ✓ | ✓ | ✓ | `rust-analyzer` |
4345| scala | ✓ | | ✓ | `metals` |
book/src/themes.md+9−7
@@ -1,14 +1,14 @@
11# Themes
22
3−First you'll need to place selected themes in your `themes` directory (i.e `~/.config/helix/themes`), the directory might have to be created beforehand.
3+To use a theme add `theme = "<name>"` to your [`config.toml`](./configuration.md) at the very top of the file before the first section or select it during runtime using `:theme <name>`.
44
5−To use a custom theme add `theme = <name>` to your [`config.toml`](./configuration.md) or override it during runtime using `:theme <name>`.
5+## Creating a theme
66
7−The default theme.toml can be found [here](https://github.com/helix-editor/helix/blob/master/theme.toml), and user submitted themes [here](https://github.com/helix-editor/helix/blob/master/runtime/themes).
7+Create a file with the name of your theme as file name (i.e `mytheme.toml`) and place it in your `themes` directory (i.e `~/.config/helix/themes`). The directory might have to be created beforehand.
88
9−## Creating a theme
9+The names "default" and "base16_default" are reserved for the builtin themes and cannot be overridden by user defined themes.
1010
11−First create a file with the name of your theme as file name (i.e `mytheme.toml`) and place it in your `themes` directory (i.e `~/.config/helix/themes`).
11+The default theme.toml can be found [here](https://github.com/helix-editor/helix/blob/master/theme.toml), and user submitted themes [here](https://github.com/helix-editor/helix/blob/master/runtime/themes).
1212
1313Each line in the theme file is specified as below:
1414
@@ -147,6 +147,7 @@ We use a similar set of scopes as
147147 - `repeat` - `for`, `while`, `loop`
148148 - `import` - `import`, `export`
149149 - `return`
150+ - `exception`
150151 - `operator` - `or`, `in`
151152 - `directive` - Preprocessor directives (`#if` in C)
152153 - `function` - `fn`, `func`
@@ -171,8 +172,9 @@ We use a similar set of scopes as
171172 - `bold`
172173 - `italic`
173174 - `link`
174− - `url`
175− - `label`
175+ - `url` - urls pointed to by links
176+ - `label` - non-url link references
177+ - `text` - url and image descriptions in links
176178 - `quote`
177179 - `raw`
178180 - `inline`
helix-core/src/object.rs+1−1
@@ -12,7 +12,7 @@ pub fn expand_selection(syntax: &Syntax, text: RopeSlice, selection: &Selection)
1212 .root_node()
1313 .descendant_for_byte_range(from, to)
1414 .and_then(|node| {
15− if node.child_count() == 0 || (node.start_byte() == from && node.end_byte() == to) {
15+ if node.start_byte() == from && node.end_byte() == to {
1616 node.parent()
1717 } else {
1818 Some(node)
helix-syntax/build.rs−1
@@ -175,7 +175,6 @@ fn build_dir(dir: &str, language: &str) {
175175fn main() {
176176 let ignore = vec![
177177 "tree-sitter-typescript".to_string(),
178− "tree-sitter-haskell".to_string(), // aarch64 failures: https://github.com/tree-sitter/tree-sitter-haskell/issues/34
179178 "tree-sitter-ocaml".to_string(),
180179 ];
181180 let dirs = collect_tree_sitter_dirs(&ignore).unwrap();
helix-syntax/languages/tree-sitter-haskell+1−1

Submodule changed.

helix-syntax/languages/tree-sitter-makenew file+1

Submodule changed.

helix-syntax/languages/tree-sitter-regexnew file+1

Submodule changed.

helix-term/src/config.rs+28−23
@@ -20,14 +20,18 @@ pub struct LspConfig {
2020 pub display_messages: bool,
2121}
2222
23−#[test]
24−fn parsing_keymaps_config_file() {
25− use crate::keymap;
26− use crate::keymap::Keymap;
27− use helix_core::hashmap;
28− use helix_view::document::Mode;
29−
30− let sample_keymaps = r#"
23+#[cfg(test)]
24+mod tests {
25+ use super::*;
26+
27+ #[test]
28+ fn parsing_keymaps_config_file() {
29+ use crate::keymap;
30+ use crate::keymap::Keymap;
31+ use helix_core::hashmap;
32+ use helix_view::document::Mode;
33+
34+ let sample_keymaps = r#"
3135 [keys.insert]
3236 y = "move_line_down"
3337 S-C-a = "delete_selection"
@@ -36,19 +40,20 @@ fn parsing_keymaps_config_file() {
3640 A-F12 = "move_next_word_end"
3741 "#;
3842
39− assert_eq!(
40− toml::from_str::<Config>(sample_keymaps).unwrap(),
41− Config {
42− keys: Keymaps(hashmap! {
43− Mode::Insert => Keymap::new(keymap!({ "Insert mode"
44− "y" => move_line_down,
45− "S-C-a" => delete_selection,
46− })),
47− Mode::Normal => Keymap::new(keymap!({ "Normal mode"
48− "A-F12" => move_next_word_end,
49− })),
50− }),
51− ..Default::default()
52− }
53− );
43+ assert_eq!(
44+ toml::from_str::<Config>(sample_keymaps).unwrap(),
45+ Config {
46+ keys: Keymaps(hashmap! {
47+ Mode::Insert => Keymap::new(keymap!({ "Insert mode"
48+ "y" => move_line_down,
49+ "S-C-a" => delete_selection,
50+ })),
51+ Mode::Normal => Keymap::new(keymap!({ "Normal mode"
52+ "A-F12" => move_next_word_end,
53+ })),
54+ }),
55+ ..Default::default()
56+ }
57+ );
58+ }
5459}
helix-view/src/theme.rs+45−40
@@ -296,53 +296,58 @@ impl TryFrom<Value> for ThemePalette {
296296 }
297297}
298298
299−#[test]
300−fn test_parse_style_string() {
301− let fg = Value::String("#ffffff".to_string());
299+#[cfg(test)]
300+mod tests {
301+ use super::*;
302302
303− let mut style = Style::default();
304− let palette = ThemePalette::default();
305− palette.parse_style(&mut style, fg).unwrap();
303+ #[test]
304+ fn test_parse_style_string() {
305+ let fg = Value::String("#ffffff".to_string());
306306
307− assert_eq!(style, Style::default().fg(Color::Rgb(255, 255, 255)));
308−}
307+ let mut style = Style::default();
308+ let palette = ThemePalette::default();
309+ palette.parse_style(&mut style, fg).unwrap();
309310
310−#[test]
311−fn test_palette() {
312− use helix_core::hashmap;
313− let fg = Value::String("my_color".to_string());
311+ assert_eq!(style, Style::default().fg(Color::Rgb(255, 255, 255)));
312+ }
314313
315− let mut style = Style::default();
316− let palette =
317− ThemePalette::new(hashmap! { "my_color".to_string() => Color::Rgb(255, 255, 255) });
318− palette.parse_style(&mut style, fg).unwrap();
314+ #[test]
315+ fn test_palette() {
316+ use helix_core::hashmap;
317+ let fg = Value::String("my_color".to_string());
319318
320− assert_eq!(style, Style::default().fg(Color::Rgb(255, 255, 255)));
321−}
319+ let mut style = Style::default();
320+ let palette =
321+ ThemePalette::new(hashmap! { "my_color".to_string() => Color::Rgb(255, 255, 255) });
322+ palette.parse_style(&mut style, fg).unwrap();
322323
323−#[test]
324−fn test_parse_style_table() {
325− let table = toml::toml! {
326− "keyword" = {
327− fg = "#ffffff",
328− bg = "#000000",
329− modifiers = ["bold"],
330− }
331− };
324+ assert_eq!(style, Style::default().fg(Color::Rgb(255, 255, 255)));
325+ }
332326
333− let mut style = Style::default();
334− let palette = ThemePalette::default();
335− if let Value::Table(entries) = table {
336− for (_name, value) in entries {
337− palette.parse_style(&mut style, value).unwrap();
327+ #[test]
328+ fn test_parse_style_table() {
329+ let table = toml::toml! {
330+ "keyword" = {
331+ fg = "#ffffff",
332+ bg = "#000000",
333+ modifiers = ["bold"],
334+ }
335+ };
336+
337+ let mut style = Style::default();
338+ let palette = ThemePalette::default();
339+ if let Value::Table(entries) = table {
340+ for (_name, value) in entries {
341+ palette.parse_style(&mut style, value).unwrap();
342+ }
338343 }
339− }
340344
341− assert_eq!(
342− style,
343− Style::default()
344− .fg(Color::Rgb(255, 255, 255))
345− .bg(Color::Rgb(0, 0, 0))
346− .add_modifier(Modifier::BOLD)
347− );
345+ assert_eq!(
346+ style,
347+ Style::default()
348+ .fg(Color::Rgb(255, 255, 255))
349+ .bg(Color::Rgb(0, 0, 0))
350+ .add_modifier(Modifier::BOLD)
351+ );
352+ }
348353}
languages.toml+15
@@ -128,6 +128,7 @@ roots = []
128128comment-token = "//"
129129# TODO: highlights-jsx, highlights-params
130130
131+language-server = { command = "typescript-language-server", args = ["--stdio"] }
131132indent = { tab-width = 2, unit = " " }
132133
133134[[language]]
@@ -389,6 +390,13 @@ indent = { tab-width = 2, unit = " " }
389390language-server = { command = "cmake-language-server" }
390391injection-regex = "cmake"
391392
393+[[language]]
394+name = "make"
395+scope = "source.make"
396+file-types = ["Makefile", "makefile", "justfile", ".justfile"]
397+roots =[]
398+comment-token = "#"
399+
392400[[language]]
393401name = "glsl"
394402scope = "source.glsl"
@@ -530,3 +538,10 @@ file-types = ["git-rebase-todo"]
530538injection-regex = "git-rebase"
531539comment-token = "#"
532540indent = { tab-width = 2, unit = " " }
541+
542+[[language]]
543+name = "regex"
544+scope = "source.regex"
545+injection-regex = "regex"
546+file-types = ["regex"]
547+roots = []
runtime/queries/elixir/injections.scm+7
@@ -1,2 +1,9 @@
11((comment) @injection.content
22 (#set! injection.language "comment"))
3+
4+((sigil
5+ (sigil_name) @_sigil_name
6+ (quoted_content) @injection.content)
7+ (#match? @_sigil_name "^(r|R)$")
8+ (#set! injection.language "regex")
9+ (#set! injection.combined))
runtime/queries/haskell/highlights.scm+118−38
@@ -1,45 +1,125 @@
1−(variable) @variable
2−(operator) @operator
3−(exp_name (constructor) @constructor)
4−(constructor_operator) @operator
5−(module) @namespace
6−(type) @type
7−(type) @class
8−(constructor) @constructor
9−(pragma) @pragma
10−(comment) @comment
11−(signature name: (variable) @type)
12−(function name: (variable) @function)
13−(constraint class: (class_name (type)) @class)
14−(class (class_head class: (class_name (type)) @class))
15−(instance (instance_head class: (class_name (type)) @class))
1+;; ----------------------------------------------------------------------------
2+;; Literals and comments
3+
164(integer) @constant.numeric.integer
5+(exp_negation) @constant.numeric.integer
176(exp_literal (float)) @constant.numeric.float
187(char) @constant.character
19−(con_unit) @literal
20−(con_list) @literal
21−(tycon_arrow) @operator
22−(where) @keyword
23−"module" @keyword
24−"let" @keyword
25−"in" @keyword
26−"class" @keyword
27−"instance" @keyword
28−"data" @keyword
29−"newtype" @keyword
30−"family" @keyword
31−"type" @keyword
32−"import" @keyword
33−"qualified" @keyword
34−"as" @keyword
35−"deriving" @keyword
36−"via" @keyword
37−"stock" @keyword
38−"anyclass" @keyword
39−"do" @keyword
40−"mdo" @keyword
41−"rec" @keyword
8+(string) @string
9+
10+(con_unit) @constant.builtin ; unit, as in ()
11+
12+(comment) @comment
13+
14+
15+;; ----------------------------------------------------------------------------
16+;; Punctuation
17+
4218[
4319 "("
4420 ")"
21+ "{"
22+ "}"
23+ "["
24+ "]"
4525] @punctuation.bracket
26+
27+[
28+ (comma)
29+ ";"
30+] @punctuation.delimiter
31+
32+
33+;; ----------------------------------------------------------------------------
34+;; Keywords, operators, includes
35+
36+(pragma) @constant.macro
37+
38+[
39+ "if"
40+ "then"
41+ "else"
42+ "case"
43+ "of"
44+] @keyword.control.conditional
45+
46+[
47+ "import"
48+ "qualified"
49+ "module"
50+] @keyword.control.import
51+
52+[
53+ (operator)
54+ (constructor_operator)
55+ (type_operator)
56+ (tycon_arrow)
57+ (qualified_module) ; grabs the `.` (dot), ex: import System.IO
58+ (all_names)
59+ (wildcard)
60+ "="
61+ "|"
62+ "::"
63+ "=>"
64+ "->"
65+ "<-"
66+ "\\"
67+ "`"
68+ "@"
69+] @operator
70+
71+(qualified_module (module) @constructor)
72+(qualified_type (module) @namespace)
73+(qualified_variable (module) @namespace)
74+(import (module) @namespace)
75+
76+[
77+ (where)
78+ "let"
79+ "in"
80+ "class"
81+ "instance"
82+ "data"
83+ "newtype"
84+ "family"
85+ "type"
86+ "as"
87+ "hiding"
88+ "deriving"
89+ "via"
90+ "stock"
91+ "anyclass"
92+ "do"
93+ "mdo"
94+ "rec"
95+ "forall"
96+ "∀"
97+ "infix"
98+ "infixl"
99+ "infixr"
100+] @keyword
101+
102+
103+;; ----------------------------------------------------------------------------
104+;; Functions and variables
105+
106+(signature name: (variable) @type)
107+(function name: (variable) @function)
108+
109+(variable) @variable
110+"_" @variable.builtin
111+
112+(exp_infix (variable) @operator) ; consider infix functions as operators
113+
114+("@" @namespace) ; "as" pattern operator, e.g. x@Constructor
115+
116+
117+;; ----------------------------------------------------------------------------
118+;; Types
119+
120+(type) @type
121+
122+(constructor) @constructor
123+
124+; True or False
125+((constructor) @_bool (#match? @_bool "(True|False)")) @constant.builtin.boolean
runtime/queries/make/highlights.scmnew file+170
@@ -0,0 +1,170 @@
1+[
2+ "("
3+ ")"
4+ "{"
5+ "}"
6+] @punctuation.bracket
7+
8+[
9+ ":"
10+ "&:"
11+ "::"
12+ "|"
13+ ";"
14+ "\""
15+ "'"
16+ ","
17+] @punctuation.delimiter
18+
19+[
20+ "$"
21+ "$$"
22+] @punctuation.special
23+
24+(automatic_variable
25+ [ "@" "%" "<" "?" "^" "+" "/" "*" "D" "F"] @punctuation.special)
26+
27+(automatic_variable
28+ "/" @error . ["D" "F"])
29+
30+[
31+ "="
32+ ":="
33+ "::="
34+ "?="
35+ "+="
36+ "!="
37+ "@"
38+ "-"
39+ "+"
40+] @operator
41+
42+[
43+ (text)
44+ (string)
45+ (raw_text)
46+] @string
47+
48+(variable_assignment (word) @string)
49+
50+[
51+ "ifeq"
52+ "ifneq"
53+ "ifdef"
54+ "ifndef"
55+ "else"
56+ "endif"
57+ "if"
58+ "or" ; boolean functions are conditional in make grammar
59+ "and"
60+] @keyword.control.conditional
61+
62+"foreach" @keyword.control.repeat
63+
64+[
65+ "define"
66+ "endef"
67+ "vpath"
68+ "undefine"
69+ "export"
70+ "unexport"
71+ "override"
72+ "private"
73+; "load"
74+] @keyword
75+
76+[
77+ "include"
78+ "sinclude"
79+ "-include"
80+] @keyword.control.import
81+
82+[
83+ "subst"
84+ "patsubst"
85+ "strip"
86+ "findstring"
87+ "filter"
88+ "filter-out"
89+ "sort"
90+ "word"
91+ "words"
92+ "wordlist"
93+ "firstword"
94+ "lastword"
95+ "dir"
96+ "notdir"
97+ "suffix"
98+ "basename"
99+ "addsuffix"
100+ "addprefix"
101+ "join"
102+ "wildcard"
103+ "realpath"
104+ "abspath"
105+ "call"
106+ "eval"
107+ "file"
108+ "value"
109+ "shell"
110+] @keyword.function
111+
112+[
113+ "error"
114+ "warning"
115+ "info"
116+] @keyword.control.exception
117+
118+;; Variable
119+(variable_assignment
120+ name: (word) @variable)
121+
122+(variable_reference
123+ (word) @variable)
124+
125+(comment) @comment
126+
127+((word) @clean @string.regexp
128+ (#match? @clean "[%\*\?]"))
129+
130+(function_call
131+ function: "error"
132+ (arguments (text) @error))
133+
134+(function_call
135+ function: "warning"
136+ (arguments (text) @warning))
137+
138+(function_call
139+ function: "info"
140+ (arguments (text) @info))
141+
142+;; Install Command Categories
143+;; Others special variables
144+;; Variables Used by Implicit Rules
145+[
146+ "VPATH"
147+ ".RECIPEPREFIX"
148+] @constant.builtin
149+
150+(variable_assignment
151+ name: (word) @clean @constant.builtin
152+ (#match? @clean "^(AR|AS|CC|CXX|CPP|FC|M2C|PC|CO|GET|LEX|YACC|LINT|MAKEINFO|TEX|TEXI2DVI|WEAVE|CWEAVE|TANGLE|CTANGLE|RM|ARFLAGS|ASFLAGS|CFLAGS|CXXFLAGS|COFLAGS|CPPFLAGS|FFLAGS|GFLAGS|LDFLAGS|LDLIBS|LFLAGS|YFLAGS|PFLAGS|RFLAGS|LINTFLAGS|PRE_INSTALL|POST_INSTALL|NORMAL_INSTALL|PRE_UNINSTALL|POST_UNINSTALL|NORMAL_UNINSTALL|MAKEFILE_LIST|MAKE_RESTARTS|MAKE_TERMOUT|MAKE_TERMERR|\.DEFAULT_GOAL|\.RECIPEPREFIX|\.EXTRA_PREREQS)$"))
153+
154+(variable_reference
155+ (word) @clean @constant.builtin
156+ (#match? @clean "^(AR|AS|CC|CXX|CPP|FC|M2C|PC|CO|GET|LEX|YACC|LINT|MAKEINFO|TEX|TEXI2DVI|WEAVE|CWEAVE|TANGLE|CTANGLE|RM|ARFLAGS|ASFLAGS|CFLAGS|CXXFLAGS|COFLAGS|CPPFLAGS|FFLAGS|GFLAGS|LDFLAGS|LDLIBS|LFLAGS|YFLAGS|PFLAGS|RFLAGS|LINTFLAGS|PRE_INSTALL|POST_INSTALL|NORMAL_INSTALL|PRE_UNINSTALL|POST_UNINSTALL|NORMAL_UNINSTALL|MAKEFILE_LIST|MAKE_RESTARTS|MAKE_TERMOUT|MAKE_TERMERR|\.DEFAULT_GOAL|\.RECIPEPREFIX|\.EXTRA_PREREQS\.VARIABLES|\.FEATURES|\.INCLUDE_DIRS|\.LOADED)$"))
157+
158+;; Standart targets
159+(targets
160+ (word) @constant.macro
161+ (#match? @constant.macro "^(all|install|install-html|install-dvi|install-pdf|install-ps|uninstall|install-strip|clean|distclean|mostlyclean|maintainer-clean|TAGS|info|dvi|html|pdf|ps|dist|check|installcheck|installdirs)$"))
162+
163+(targets
164+ (word) @constant.macro
165+ (#match? @constant.macro "^(all|install|install-html|install-dvi|install-pdf|install-ps|uninstall|install-strip|clean|distclean|mostlyclean|maintainer-clean|TAGS|info|dvi|html|pdf|ps|dist|check|installcheck|installdirs)$"))
166+
167+;; Builtin targets
168+(targets
169+ (word) @constant.macro
170+ (#match? @constant.macro "^\.(PHONY|SUFFIXES|DEFAULT|PRECIOUS|INTERMEDIATE|SECONDARY|SECONDEXPANSION|DELETE_ON_ERROR|IGNORE|LOW_RESOLUTION_TIME|SILENT|EXPORT_ALL_VARIABLES|NOTPARALLEL|ONESHELL|POSIX)$"))
runtime/queries/markdown/highlights.scm+5
@@ -21,6 +21,11 @@
2121(link_destination) @markup.link.url
2222(link_label) @markup.link.label
2323
24+[
25+ (link_text)
26+ (image_description)
27+] @markup.link.text
28+
2429[
2530 (list_marker_plus)
2631 (list_marker_minus)
runtime/queries/regex/highlights.scmnew file+53
@@ -0,0 +1,53 @@
1+; upstream: https://github.com/tree-sitter/tree-sitter-regex/blob/e1cfca3c79896ff79842f057ea13e529b66af636/queries/highlights.scm
2+
3+[
4+ "("
5+ ")"
6+ "(?"
7+ "(?:"
8+ "(?<"
9+ ">"
10+ "["
11+ "]"
12+ "{"
13+ "}"
14+] @punctuation.bracket
15+
16+[
17+ "*"
18+ "+"
19+ "|"
20+ "="
21+ "<="
22+ "!"
23+ "<!"
24+ "?"
25+] @operator
26+
27+[
28+ (identity_escape)
29+ (control_letter_escape)
30+ (character_class_escape)
31+ (control_escape)
32+ (start_assertion)
33+ (end_assertion)
34+ (boundary_assertion)
35+ (non_boundary_assertion)
36+] @constant.character.escape
37+
38+(group_name) @property
39+
40+(count_quantifier
41+ [
42+ (decimal_digits) @constant.numeric
43+ "," @punctuation.delimiter
44+ ])
45+
46+(character_class
47+ [
48+ "^" @operator
49+ (class_range "-" @operator)
50+ ])
51+
52+(class_character) @constant.character
53+(pattern_character) @string
runtime/queries/rust/injections.scm+14
@@ -10,3 +10,17 @@
1010 (token_tree) @injection.content)
1111 (#set! injection.language "rust")
1212 (#set! injection.include-children))
13+
14+(call_expression
15+ function: (scoped_identifier
16+ path: (identifier) @_regex (#eq? @_regex "Regex")
17+ name: (identifier) @_new (#eq? @_new "new"))
18+ arguments: (arguments (raw_string_literal) @injection.content)
19+ (#set! injection.language "regex"))
20+
21+(call_expression
22+ function: (scoped_identifier
23+ path: (scoped_identifier (identifier) @_regex (#eq? @_regex "Regex") .)
24+ name: (identifier) @_new (#eq? @_new "new"))
25+ arguments: (arguments (raw_string_literal) @injection.content)
26+ (#set! injection.language "regex"))
theme.toml+1
@@ -32,6 +32,7 @@ label = "honey"
3232"markup.bold" = { modifiers = ["bold"] }
3333"markup.italic" = { modifiers = ["italic"] }
3434"markup.link.url" = { fg = "silver", modifiers = ["underlined"] }
35+"markup.link.text" = "almond"
3536"markup.raw" = "almond"
3637
3738"diff.plus" = "#35bf86"