mirror of
https://github.com/helix-editor/helix.git
synced 2025-04-04 19:37:54 +03:00
queries: Inject markdown into Rust doc comments
Co-authored-by: Nik Revenco <154856872+nik-rev@users.noreply.github.com>
This commit is contained in:
parent
ac88096c98
commit
813f771c0a
5 changed files with 30 additions and 1 deletions
14
runtime/queries/markdown-rustdoc/injections.scm
Normal file
14
runtime/queries/markdown-rustdoc/injections.scm
Normal file
|
@ -0,0 +1,14 @@
|
|||
; inherits: markdown
|
||||
|
||||
; In Rust, it is common to have documentation code blocks not specify the
|
||||
; language, and it is assumed to be Rust if it is not specified.
|
||||
|
||||
(fenced_code_block
|
||||
(code_fence_content) @injection.content
|
||||
(#set! injection.language "rust")
|
||||
(#set! injection.include-unnamed-children))
|
||||
|
||||
(fenced_code_block
|
||||
(info_string
|
||||
(language) @injection.language)
|
||||
(code_fence_content) @injection.content (#set! injection.include-unnamed-children))
|
Loading…
Add table
Add a link
Reference in a new issue