rust: Fix test/doctest tasks showing up outside of tests (#25787)
Closes #ISSUE Release Notes: - Fixes Rust test tasks showing up outside of tests
This commit is contained in:
parent
62fb555e18
commit
b15aa5e018
2 changed files with 33 additions and 16 deletions
|
@ -22,7 +22,7 @@
|
|||
[(line_comment) (block_comment)] *
|
||||
.
|
||||
(function_item
|
||||
name: (_) @run
|
||||
name: (_) @run @_test_name
|
||||
body: _
|
||||
) @_end
|
||||
)
|
||||
|
@ -35,34 +35,35 @@
|
|||
(line_comment) *
|
||||
(line_comment
|
||||
doc: (_) @_comment_content
|
||||
) @start
|
||||
) @_start @run
|
||||
(#match? @_comment_content "```")
|
||||
.
|
||||
(line_comment) *
|
||||
.
|
||||
(line_comment
|
||||
doc: (_) @_end_comment_content
|
||||
) @_end_code_block
|
||||
(#match? @_end_comment_content "```")
|
||||
.
|
||||
(line_comment) *
|
||||
(attribute_item) *
|
||||
.
|
||||
[(line_comment) (block_comment)] *
|
||||
.
|
||||
[(function_item
|
||||
name: (_) @run
|
||||
name: (_) @_doc_test_name
|
||||
body: _
|
||||
) (function_signature_item
|
||||
name: (_) @run
|
||||
name: (_) @_doc_test_name
|
||||
) (struct_item
|
||||
name: (_) @run
|
||||
name: (_) @_doc_test_name
|
||||
) (enum_item
|
||||
name: (_) @run
|
||||
name: (_) @_doc_test_name
|
||||
body: _
|
||||
) (
|
||||
(attribute_item) ?
|
||||
(macro_definition
|
||||
name: (_) @run)
|
||||
name: (_) @_doc_test_name)
|
||||
) (mod_item
|
||||
name: (_) @run
|
||||
name: (_) @_doc_test_name
|
||||
)] @_end
|
||||
)
|
||||
(#set! tag rust-doc-test)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue