on master help sign in
Add c++, js, css, html language definitions.
3bab640Blaž Hrastnik
helix-syntax/build.rs+1−4
@@ -107,10 +107,7 @@ fn build_dir(dir: &str, language: &str) {
107}
107}
108
108
109fn main() {
109fn main() {
110− let ignore = vec![
111− "tree-sitter-typescript".to_string(),
110+ let ignore = vec!["tree-sitter-typescript".to_string()];
112− "tree-sitter-cpp".to_string(),
113− ];
114 let dirs = collect_tree_sitter_dirs(&ignore);
111 let dirs = collect_tree_sitter_dirs(&ignore);
115
112
116 let mut n_jobs = 0;
113 let mut n_jobs = 0;
helix-syntax/src/lib.rs+1−1
@@ -70,7 +70,7 @@ mk_langs!(
70 (Bash, tree_sitter_bash),
70 (Bash, tree_sitter_bash),
71 (C, tree_sitter_c),
71 (C, tree_sitter_c),
72 (CSharp, tree_sitter_c_sharp),
72 (CSharp, tree_sitter_c_sharp),
73− // (Cpp, tree_sitter_cpp),
73+ (Cpp, tree_sitter_cpp),
74 (Css, tree_sitter_css),
74 (Css, tree_sitter_css),
75 (Go, tree_sitter_go),
75 (Go, tree_sitter_go),
76 // (Haskell, tree_sitter_haskell),
76 // (Haskell, tree_sitter_haskell),
languages.toml+41
@@ -18,3 +18,44 @@ roots = []
18path = "../helix-syntax/languages/tree-sitter-toml"
18path = "../helix-syntax/languages/tree-sitter-toml"
19
19
20indent = { tab-width = 2, unit = " " }
20indent = { tab-width = 2, unit = " " }
21+
22+[[language]]
23+name = "cpp"
24+scope = "source.cpp"
25+injection-regex = "cpp"
26+file-types = ["cc", "cpp", "hpp", "h"]
27+roots = []
28+path = "../helix-syntax/languages/tree-sitter-cpp" # TODO: also C highlights
29+
30+indent = { tab-width = 2, unit = " " }
31+
32+[[language]]
33+name = "javascript"
34+scope = "source.js"
35+injection-regex = "^(js|javascript)$"
36+file-types = ["js"]
37+roots = []
38+path = "../helix-syntax/languages/tree-sitter-javascript"
39+# TODO: highlights-jsx, highlights-params
40+
41+indent = { tab-width = 2, unit = " " }
42+
43+[[language]]
44+name = "css"
45+scope = "source.css"
46+injection-regex = "css"
47+file-types = ["css"]
48+roots = []
49+path = "../helix-syntax/languages/tree-sitter-css"
50+
51+indent = { tab-width = 2, unit = " " }
52+
53+[[language]]
54+name = "html"
55+scope = "text.html.basic"
56+injection-regex = "html"
57+file-types = ["html"]
58+roots = []
59+path = "../helix-syntax/languages/tree-sitter-html"
60+
61+indent = { tab-width = 2, unit = " " }
theme.toml+5−3
@@ -3,7 +3,8 @@
3"punctuation" = "#a4a0e8" # lavender
3"punctuation" = "#a4a0e8" # lavender
4"punctuation.delimiter" = "#a4a0e8" # lavender
4"punctuation.delimiter" = "#a4a0e8" # lavender
5"operator" = "#dbbfef" # lilac
5"operator" = "#dbbfef" # lilac
6−"property" = "#a4a0e8" # lavender
6+# "property" = "#a4a0e8" # lavender
7+"property" = "#ffffff" # white
7"variable.parameter" = "#a4a0e8" # lavender
8"variable.parameter" = "#a4a0e8" # lavender
8# TODO distinguish type from type.builtin?
9# TODO distinguish type from type.builtin?
9"type" = "#ffffff" # white
10"type" = "#ffffff" # white
@@ -16,6 +17,7 @@
16"constant" = "#ffffff" # white
17"constant" = "#ffffff" # white
17"constant.builtin" = "#ffffff" # white
18"constant.builtin" = "#ffffff" # white
18"string" = "#cccccc" # silver
19"string" = "#cccccc" # silver
20+"number" = "#e8dca0" # chamois
19"escape" = "#efba5d" # honey
21"escape" = "#efba5d" # honey
20# used for lifetimes
22# used for lifetimes
21"label" = "#efba5d" # honey
23"label" = "#efba5d" # honey
@@ -24,13 +26,13 @@
24# TODO: diferentiate doc comment
26# TODO: diferentiate doc comment
25# TODO: variable as lilac
27# TODO: variable as lilac
26# TODO: mod/use statements as white
28# TODO: mod/use statements as white
27−# TODO: mod stuff as chamoise
29+# TODO: mod stuff as chamois
28# TODO: add "(scoped_identifier) @path" for std::mem::
30# TODO: add "(scoped_identifier) @path" for std::mem::
29#
31#
30# concat (ERROR) @syntax-error and "MISSING ;" selectors for errors
32# concat (ERROR) @syntax-error and "MISSING ;" selectors for errors
31
33
32"module" = "#ff0000"
34"module" = "#ff0000"
33−"variable" = "#ff0000"
35+"variable" = "#a4a0e8" # lavender
34"function.builtin" = "#ff0000"
36"function.builtin" = "#ff0000"
35
37
36"ui.background" = { bg = "#3b224c" } # midnight
38"ui.background" = { bg = "#3b224c" } # midnight