Merge pull request #664 from atmnirbhar/master

add Hare tree sitter
This commit is contained in:
Dongdong Zhou 2022-06-21 22:33:49 +01:00 committed by GitHub
commit 9f0b0a67ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 3 deletions

View File

@ -39,6 +39,7 @@ tree-sitter-glimmer = { git = "https://github.com/VixieTSQ/tree-sitter-glimmer",
tree-sitter-haxe = { git = "https://github.com/VixieTSQ/tree-sitter-haxe", version = "0.0.1", optional = true }
tree-sitter-hcl = { git = "https://github.com/VixieTSQ/tree-sitter-hcl", version = "0.0.1", optional = true }
tree-sitter-scss = { git = "https://github.com/VixieTSQ/tree-sitter-scss", version = "0.0.1", branch = "patch-1", optional = true }
tree-sitter-hare = { version = "0.20.7", optional = true }
lsp-types = { version = "0.89.2", features = ["proposed"] }
xi-rope = { git = "https://github.com/lapce/xi-editor", features = ["serde"] }
lapce-rpc = { path = "../lapce-rpc" }
@ -71,4 +72,5 @@ lang-ocaml = ["dep:tree-sitter-ocaml"]
lang-glimmer = ["dep:tree-sitter-glimmer"]
lang-haxe = ["dep:tree-sitter-haxe"]
lang-hcl = ["dep:tree-sitter-hcl"]
lang-scss = ["dep:tree-sitter-scss"]
lang-scss = ["dep:tree-sitter-scss"]
lang-hare = ["dep:tree-sitter-hare"]

View File

@ -150,6 +150,8 @@ pub enum LapceLanguage {
OCamlInterface,
#[cfg(feature = "lang-scss")]
SCSS,
#[cfg(feature = "lang-hare")]
Hare,
}
// NOTE: Elements in the array must be in the same order as the enum variants of
@ -448,6 +450,16 @@ pub enum LapceLanguage {
code_lens: (DEFAULT_CODE_LENS_LIST, DEFAULT_CODE_LENS_IGNORE_LIST),
extensions: &["scss"],
},
#[cfg(feature = "lang-hare")]
SyntaxProperties {
id: LapceLanguage::Hare,
language: tree_sitter_hare::language,
highlight: tree_sitter_hare::HIGHLIGHT_QUERY,
comment: "//",
indent: " ",
code_lens: (DEFAULT_CODE_LENS_LIST, DEFAULT_CODE_LENS_IGNORE_LIST),
extensions: &["ha"],
},
];
impl LapceLanguage {
@ -707,4 +719,8 @@ fn test_ocaml_lang() {
fn test_scss_lang() {
assert_language(LapceLanguage::SCSS, &["scss"]);
}
#[cfg(feature = "lang-hare")]
fn test_hare_lang() {
assert_language(LapceLanguage::Hare, &["ha"]);
}
}

View File

@ -85,7 +85,9 @@ all-languages = [
"lang-glimmer",
"lang-haxe",
"lang-hcl",
"lang-scss"
"lang-scss",
"lang-hare"
]
lang-rust = ["lapce-core/lang-rust"]
@ -111,4 +113,5 @@ lang-ocaml = ["lapce-core/lang-ocaml"]
lang-glimmer = ["lapce-core/lang-glimmer"]
lang-haxe = ["lapce-core/lang-haxe"]
lang-hcl = ["lapce-core/lang-hcl"]
lang-scss = ["lapce-core/lang-scss"]
lang-scss = ["lapce-core/lang-scss"]
lang-hare = ["lapce-core/lang-hare"]