Skip to content

Commit

Permalink
Add c++, js, css, html language definitions.
Browse files Browse the repository at this point in the history
  • Loading branch information
archseer committed Apr 7, 2021
1 parent 463f58d commit 3bab640
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 8 deletions.
5 changes: 1 addition & 4 deletions helix-syntax/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,7 @@ fn build_dir(dir: &str, language: &str) {
}

fn main() {
let ignore = vec![
"tree-sitter-typescript".to_string(),
"tree-sitter-cpp".to_string(),
];
let ignore = vec!["tree-sitter-typescript".to_string()];
let dirs = collect_tree_sitter_dirs(&ignore);

let mut n_jobs = 0;
Expand Down
2 changes: 1 addition & 1 deletion helix-syntax/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ mk_langs!(
(Bash, tree_sitter_bash),
(C, tree_sitter_c),
(CSharp, tree_sitter_c_sharp),
// (Cpp, tree_sitter_cpp),
(Cpp, tree_sitter_cpp),
(Css, tree_sitter_css),
(Go, tree_sitter_go),
// (Haskell, tree_sitter_haskell),
Expand Down
41 changes: 41 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,44 @@ roots = []
path = "../helix-syntax/languages/tree-sitter-toml"

indent = { tab-width = 2, unit = " " }

[[language]]
name = "cpp"
scope = "source.cpp"
injection-regex = "cpp"
file-types = ["cc", "cpp", "hpp", "h"]
roots = []
path = "../helix-syntax/languages/tree-sitter-cpp" # TODO: also C highlights

indent = { tab-width = 2, unit = " " }

[[language]]
name = "javascript"
scope = "source.js"
injection-regex = "^(js|javascript)$"
file-types = ["js"]
roots = []
path = "../helix-syntax/languages/tree-sitter-javascript"
# TODO: highlights-jsx, highlights-params

indent = { tab-width = 2, unit = " " }

[[language]]
name = "css"
scope = "source.css"
injection-regex = "css"
file-types = ["css"]
roots = []
path = "../helix-syntax/languages/tree-sitter-css"

indent = { tab-width = 2, unit = " " }

[[language]]
name = "html"
scope = "text.html.basic"
injection-regex = "html"
file-types = ["html"]
roots = []
path = "../helix-syntax/languages/tree-sitter-html"

indent = { tab-width = 2, unit = " " }
8 changes: 5 additions & 3 deletions theme.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"punctuation" = "#a4a0e8" # lavender
"punctuation.delimiter" = "#a4a0e8" # lavender
"operator" = "#dbbfef" # lilac
"property" = "#a4a0e8" # lavender
# "property" = "#a4a0e8" # lavender
"property" = "#ffffff" # white
"variable.parameter" = "#a4a0e8" # lavender
# TODO distinguish type from type.builtin?
"type" = "#ffffff" # white
Expand All @@ -16,6 +17,7 @@
"constant" = "#ffffff" # white
"constant.builtin" = "#ffffff" # white
"string" = "#cccccc" # silver
"number" = "#e8dca0" # chamois
"escape" = "#efba5d" # honey
# used for lifetimes
"label" = "#efba5d" # honey
Expand All @@ -24,13 +26,13 @@
# TODO: diferentiate doc comment
# TODO: variable as lilac
# TODO: mod/use statements as white
# TODO: mod stuff as chamoise
# TODO: mod stuff as chamois
# TODO: add "(scoped_identifier) @path" for std::mem::
#
# concat (ERROR) @syntax-error and "MISSING ;" selectors for errors

"module" = "#ff0000"
"variable" = "#ff0000"
"variable" = "#a4a0e8" # lavender
"function.builtin" = "#ff0000"

"ui.background" = { bg = "#3b224c" } # midnight
Expand Down

0 comments on commit 3bab640

Please sign in to comment.