mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Complete semicolon when needed
This commit is contained in:
parent
57a260f579
commit
9fb83211f9
6 changed files with 30 additions and 26 deletions
|
@ -116,15 +116,6 @@ pub(crate) fn if_is_prev(element: SyntaxElement) -> bool {
|
|||
.is_some()
|
||||
}
|
||||
|
||||
// TODO kb generify?
|
||||
pub(crate) fn mod_is_prev(element: SyntaxElement) -> bool {
|
||||
element
|
||||
.into_token()
|
||||
.and_then(|it| previous_non_trivia_token(it))
|
||||
.filter(|it| it.kind() == MOD_KW)
|
||||
.is_some()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_if_is_prev() {
|
||||
check_pattern_is_applicable(r"if l<|>", if_is_prev);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue