Debian Codegraph @

runtime/queries/markdown-rustdoc/injections.scm

raw symbols SCIP
1 ; inherits: markdown
2
3 ; In Rust, it is common to have documentation code blocks not specify the
4 ; language, and it is assumed to be Rust if it is not specified.
5
6 (fenced_code_block
7 (code_fence_content) @injection.content
8 (#set! injection.language "rust")
9 (#set! injection.include-unnamed-children))
10
11 (fenced_code_block
12 (info_string
13 (language) @injection.language)
14 (code_fence_content) @injection.content (#set! injection.include-unnamed-children))
15
16 (fenced_code_block
17 (info_string
18 (language) @__language)
19 (code_fence_content) @injection.content
20 ; list of attributes for Rust syntax highlighting:
21 ; https://doc.rust-lang.org/rustdoc/write-documentation/documentation-tests.html#attributes
22 (#match? @__language
23 "(ignore|should_panic|no_run|compile_fail|standalone_crate|custom|edition*)")
24 (#set! injection.language "rust")
25 (#set! injection.include-unnamed-children))