mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-24 02:16:18 +04:00
Highlight Rust doc comments with markdown
The test changes are needed because of the changes to comment parsing. The `1..36` to `1..37` change is because line comments now consume the newline.
This commit is contained in:
parent
98ebeeebd8
commit
ec27d0707a
@ -2687,10 +2687,10 @@ fn test_textobject_queries() {
|
||||
)
|
||||
};
|
||||
|
||||
test("quantified_nodes", 1..36);
|
||||
test("quantified_nodes", 1..37);
|
||||
// NOTE: Enable after implementing proper node group capturing
|
||||
// test("quantified_nodes_grouped", 1..36);
|
||||
// test("multiple_nodes_grouped", 1..36);
|
||||
// test("quantified_nodes_grouped", 1..37);
|
||||
// test("multiple_nodes_grouped", 1..37);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -2861,7 +2861,7 @@ fn assert_pretty_print(
|
||||
|
||||
#[test]
|
||||
fn test_pretty_print() {
|
||||
let source = r#"/// Hello"#;
|
||||
let source = r#"// Hello"#;
|
||||
assert_pretty_print("rust", source, "(line_comment)", 0, source.len());
|
||||
|
||||
// A large tree should be indented with fields:
|
||||
|
@ -234,7 +234,7 @@ args = { attachCommands = [ "platform select remote-gdb-server", "platform conne
|
||||
|
||||
[[grammar]]
|
||||
name = "rust"
|
||||
source = { git = "https://github.com/tree-sitter/tree-sitter-rust", rev = "0431a2c60828731f27491ee9fdefe25e250ce9c9" }
|
||||
source = { git = "https://github.com/tree-sitter/tree-sitter-rust", rev = "35f4a5b8a29c161402e89dba83dcdc9876ba1dac" }
|
||||
|
||||
[[language]]
|
||||
name = "sway"
|
||||
|
@ -51,7 +51,7 @@
|
||||
(lifetime
|
||||
"'" @label
|
||||
(identifier) @label)
|
||||
(loop_label
|
||||
(label
|
||||
"'" @label
|
||||
(identifier) @label)
|
||||
|
||||
|
@ -1,6 +1,10 @@
|
||||
([(line_comment) (block_comment)] @injection.content
|
||||
([(line_comment !doc) (block_comment !doc)] @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
((doc_comment) @injection.content
|
||||
(#set! injection.language "markdown")
|
||||
(#set! injection.combined))
|
||||
|
||||
((macro_invocation
|
||||
macro:
|
||||
[
|
||||
|
Loading…
Reference in New Issue
Block a user