mirror of
https://github.com/zed-industries/zed.git
synced 2024-09-19 18:41:56 +03:00
rust: reduce false positives in runnables query (#11845)
We were marking `#[cfg(test)]`ed function as a test, which is wrong. Also allow for other attribute_items (such as #[should_panic]) between test attribute and a function item. Release Notes: - N/A
This commit is contained in:
parent
8bc41e150e
commit
266643440c
@ -1,6 +1,11 @@
|
||||
(
|
||||
(attribute_item (attribute) @attribute
|
||||
(#match? @attribute ".*test"))
|
||||
(attribute_item (attribute
|
||||
[((identifier) @_attribute)
|
||||
(scoped_identifier (identifier) @_attribute)
|
||||
])
|
||||
(#eq? @_attribute "test"))
|
||||
.
|
||||
(attribute_item) *
|
||||
.
|
||||
(function_item
|
||||
name: (_) @run)
|
||||
|
Loading…
Reference in New Issue
Block a user