mirror of https://github.com/helix-editor/helix
Compare commits
7 Commits
d92852b14c
...
23d71f3bd8
Author | SHA1 | Date |
---|---|---|
|
23d71f3bd8 | |
|
362e97e927 | |
|
ba54b6afe4 | |
|
837627dd8a | |
|
1246549afd | |
|
ada8004ea5 | |
|
2578f1b480 |
|
@ -2810,9 +2810,9 @@ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tree-house"
|
name = "tree-house"
|
||||||
version = "0.2.0"
|
version = "0.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "679e3296e503901cd9f6e116be5a43a9270222215bf6c78b4b1f4af5c3dcc62d"
|
checksum = "d00ea55222392f171ae004dd13b62edd09d995633abf0c13406a8df3547fb999"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arc-swap",
|
"arc-swap",
|
||||||
"hashbrown 0.15.4",
|
"hashbrown 0.15.4",
|
||||||
|
|
|
@ -37,7 +37,7 @@ package.helix-tui.opt-level = 2
|
||||||
package.helix-term.opt-level = 2
|
package.helix-term.opt-level = 2
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
tree-house = { version = "0.2.0", default-features = false }
|
tree-house = { version = "0.3.0", default-features = false }
|
||||||
nucleo = "0.5.0"
|
nucleo = "0.5.0"
|
||||||
slotmap = "1.0.7"
|
slotmap = "1.0.7"
|
||||||
thiserror = "2.0"
|
thiserror = "2.0"
|
||||||
|
|
|
@ -81,6 +81,10 @@ fn request_document_colors(editor: &mut Editor, doc_id: DocumentId) {
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
if futures.is_empty() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let mut all_colors = Vec::new();
|
let mut all_colors = Vec::new();
|
||||||
loop {
|
loop {
|
||||||
|
|
|
@ -1437,7 +1437,11 @@ impl Editor {
|
||||||
log::error!("failed to apply workspace edit: {err:?}")
|
log::error!("failed to apply workspace edit: {err:?}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fs::rename(old_path, &new_path)?;
|
|
||||||
|
if old_path.exists() {
|
||||||
|
fs::rename(old_path, &new_path)?;
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(doc) = self.document_by_path(old_path) {
|
if let Some(doc) = self.document_by_path(old_path) {
|
||||||
self.set_doc_path(doc.id(), &new_path);
|
self.set_doc_path(doc.id(), &new_path);
|
||||||
}
|
}
|
||||||
|
|
|
@ -937,7 +937,7 @@ indent = { tab-width = 2, unit = " " }
|
||||||
|
|
||||||
[[grammar]]
|
[[grammar]]
|
||||||
name = "html"
|
name = "html"
|
||||||
source = { git = "https://github.com/tree-sitter/tree-sitter-html", rev = "29f53d8f4f2335e61bf6418ab8958dac3282077a" }
|
source = { git = "https://github.com/tree-sitter/tree-sitter-html", rev = "cbb91a0ff3621245e890d1c50cc811bffb77a26b" }
|
||||||
|
|
||||||
[[language]]
|
[[language]]
|
||||||
name = "python"
|
name = "python"
|
||||||
|
@ -1746,6 +1746,17 @@ language-servers = [ "marksman", "markdown-oxide" ]
|
||||||
indent = { tab-width = 2, unit = " " }
|
indent = { tab-width = 2, unit = " " }
|
||||||
block-comment-tokens = { start = "<!--", end = "-->" }
|
block-comment-tokens = { start = "<!--", end = "-->" }
|
||||||
|
|
||||||
|
[language.auto-pairs]
|
||||||
|
'(' = ')'
|
||||||
|
'{' = '}'
|
||||||
|
'[' = ']'
|
||||||
|
'"' = '"'
|
||||||
|
"'" = "'"
|
||||||
|
'`' = '`'
|
||||||
|
'‘' = '’'
|
||||||
|
'«' = '»'
|
||||||
|
'“' = '”'
|
||||||
|
|
||||||
[[grammar]]
|
[[grammar]]
|
||||||
name = "markdown"
|
name = "markdown"
|
||||||
source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-markdown", rev = "62516e8c78380e3b51d5b55727995d2c511436d8", subpath = "tree-sitter-markdown" }
|
source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-markdown", rev = "62516e8c78380e3b51d5b55727995d2c511436d8", subpath = "tree-sitter-markdown" }
|
||||||
|
|
|
@ -1,3 +1,48 @@
|
||||||
; inherits: html
|
(tag_name) @tag
|
||||||
|
(erroneous_end_tag_name) @error
|
||||||
|
(doctype) @constant
|
||||||
|
(attribute_name) @attribute
|
||||||
|
(comment) @comment
|
||||||
|
|
||||||
|
((attribute
|
||||||
|
(attribute_name) @attribute
|
||||||
|
(quoted_attribute_value (attribute_value) @markup.link.url))
|
||||||
|
(#any-of? @attribute "href" "src"))
|
||||||
|
|
||||||
|
((element
|
||||||
|
(start_tag
|
||||||
|
(tag_name) @tag)
|
||||||
|
(text) @markup.link.label)
|
||||||
|
(#eq? @tag "a"))
|
||||||
|
|
||||||
|
(attribute [(attribute_value) (quoted_attribute_value)] @string)
|
||||||
|
|
||||||
|
((element
|
||||||
|
(start_tag
|
||||||
|
(tag_name) @tag)
|
||||||
|
(text) @markup.bold)
|
||||||
|
(#any-of? @tag "strong" "b"))
|
||||||
|
|
||||||
|
((element
|
||||||
|
(start_tag
|
||||||
|
(tag_name) @tag)
|
||||||
|
(text) @markup.italic)
|
||||||
|
(#any-of? @tag "em" "i"))
|
||||||
|
|
||||||
|
((element
|
||||||
|
(start_tag
|
||||||
|
(tag_name) @tag)
|
||||||
|
(text) @markup.strikethrough)
|
||||||
|
(#any-of? @tag "s" "del"))
|
||||||
|
|
||||||
|
[
|
||||||
|
"<"
|
||||||
|
">"
|
||||||
|
"</"
|
||||||
|
"/>"
|
||||||
|
"<!"
|
||||||
|
] @punctuation.bracket
|
||||||
|
|
||||||
|
"=" @punctuation.delimiter
|
||||||
|
|
||||||
["---"] @punctuation.delimiter
|
["---"] @punctuation.delimiter
|
||||||
|
|
|
@ -12,8 +12,6 @@
|
||||||
(namespace_definition name: (namespace_identifier) @namespace)
|
(namespace_definition name: (namespace_identifier) @namespace)
|
||||||
(namespace_identifier) @namespace
|
(namespace_identifier) @namespace
|
||||||
|
|
||||||
(qualified_identifier name: (identifier) @type.enum.variant)
|
|
||||||
|
|
||||||
(auto) @type
|
(auto) @type
|
||||||
"decltype" @type
|
"decltype" @type
|
||||||
|
|
||||||
|
@ -21,12 +19,29 @@
|
||||||
(reference_declarator ["&" "&&"] @type.builtin)
|
(reference_declarator ["&" "&&"] @type.builtin)
|
||||||
(abstract_reference_declarator ["&" "&&"] @type.builtin)
|
(abstract_reference_declarator ["&" "&&"] @type.builtin)
|
||||||
|
|
||||||
|
; -------
|
||||||
; Functions
|
; Functions
|
||||||
|
; -------
|
||||||
|
; Support up to 4 levels of nesting of qualifiers
|
||||||
|
; i.e. a::b::c::d::func();
|
||||||
(call_expression
|
(call_expression
|
||||||
function: (qualified_identifier
|
function: (qualified_identifier
|
||||||
name: (identifier) @function))
|
name: (identifier) @function))
|
||||||
|
(call_expression
|
||||||
|
function: (qualified_identifier
|
||||||
|
name: (qualified_identifier
|
||||||
|
name: (identifier) @function)))
|
||||||
|
(call_expression
|
||||||
|
function: (qualified_identifier
|
||||||
|
name: (qualified_identifier
|
||||||
|
name: (qualified_identifier
|
||||||
|
name: (identifier) @function))))
|
||||||
|
(call_expression
|
||||||
|
function: (qualified_identifier
|
||||||
|
name: (qualified_identifier
|
||||||
|
name: (qualified_identifier
|
||||||
|
name: (qualified_identifier
|
||||||
|
name: (identifier) @function)))))
|
||||||
|
|
||||||
(template_function
|
(template_function
|
||||||
name: (identifier) @function)
|
name: (identifier) @function)
|
||||||
|
@ -34,26 +49,42 @@
|
||||||
(template_method
|
(template_method
|
||||||
name: (field_identifier) @function)
|
name: (field_identifier) @function)
|
||||||
|
|
||||||
; Support up to 3 levels of nesting of qualifiers
|
; Support up to 4 levels of nesting of qualifiers
|
||||||
; i.e. a::b::c::func();
|
; i.e. a::b::c::d::func();
|
||||||
(function_declarator
|
(function_declarator
|
||||||
declarator: (qualified_identifier
|
declarator: (qualified_identifier
|
||||||
name: (identifier) @function))
|
name: (identifier) @function))
|
||||||
|
|
||||||
(function_declarator
|
(function_declarator
|
||||||
declarator: (qualified_identifier
|
declarator: (qualified_identifier
|
||||||
name: (qualified_identifier
|
name: (qualified_identifier
|
||||||
name: (identifier) @function)))
|
name: (identifier) @function)))
|
||||||
|
|
||||||
(function_declarator
|
(function_declarator
|
||||||
declarator: (qualified_identifier
|
declarator: (qualified_identifier
|
||||||
name: (qualified_identifier
|
name: (qualified_identifier
|
||||||
name: (qualified_identifier
|
name: (qualified_identifier
|
||||||
name: (identifier) @function))))
|
name: (identifier) @function))))
|
||||||
|
(function_declarator
|
||||||
|
declarator: (qualified_identifier
|
||||||
|
name: (qualified_identifier
|
||||||
|
name: (qualified_identifier
|
||||||
|
name: (qualified_identifier
|
||||||
|
name: (identifier) @function)))))
|
||||||
|
|
||||||
(function_declarator
|
(function_declarator
|
||||||
declarator: (field_identifier) @function)
|
declarator: (field_identifier) @function)
|
||||||
|
|
||||||
|
; Constructors
|
||||||
|
|
||||||
|
(class_specifier
|
||||||
|
(type_identifier) @type
|
||||||
|
(field_declaration_list
|
||||||
|
(function_definition
|
||||||
|
(function_declarator
|
||||||
|
(identifier) @constructor)))
|
||||||
|
(#eq? @type @constructor))
|
||||||
|
(destructor_name "~" @constructor
|
||||||
|
(identifier) @constructor)
|
||||||
|
|
||||||
; Parameters
|
; Parameters
|
||||||
|
|
||||||
(parameter_declaration
|
(parameter_declaration
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
(erroneous_end_tag_name) @error
|
(erroneous_end_tag_name) @error
|
||||||
(doctype) @constant
|
(doctype) @constant
|
||||||
(attribute_name) @attribute
|
(attribute_name) @attribute
|
||||||
|
(entity) @string.special.symbol
|
||||||
(comment) @comment
|
(comment) @comment
|
||||||
|
|
||||||
((attribute
|
((attribute
|
||||||
|
|
Loading…
Reference in New Issue