mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-02 04:48:13 +00:00
Add a check_assist_* overload and move tests under assists
This commit is contained in:
parent
fc10fe44de
commit
9d5a97368a
3 changed files with 66 additions and 37 deletions
|
|
@ -217,7 +217,9 @@ pub(crate) fn generate_delegate_methods(acc: &mut Assists, ctx: &AssistContext<'
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::tests::{check_assist, check_assist_not_applicable};
|
||||
use crate::tests::{
|
||||
check_assist, check_assist_not_applicable, check_assist_not_applicable_no_grouping,
|
||||
};
|
||||
|
||||
use super::*;
|
||||
|
||||
|
|
@ -721,4 +723,21 @@ impl Person {
|
|||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn delegate_method_skipped_when_no_grouping() {
|
||||
check_assist_not_applicable_no_grouping(
|
||||
generate_delegate_methods,
|
||||
r#"
|
||||
struct Age(u8);
|
||||
impl Age {
|
||||
fn age(&self) -> u8 {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
struct Person {
|
||||
ag$0e: Age,
|
||||
}"#,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue