mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Implemented T! macro for syntax kinds
This commit is contained in:
parent
ef782adc29
commit
57bb618fd3
6 changed files with 114 additions and 1 deletions
|
@ -4,6 +4,7 @@ use ra_syntax::{
|
|||
algo::{find_covering_element, find_token_at_offset, TokenAtOffset},
|
||||
SyntaxKind::*, SyntaxToken,
|
||||
ast::{self, AstNode, AstToken},
|
||||
T
|
||||
};
|
||||
|
||||
use crate::{FileRange, db::RootDatabase};
|
||||
|
@ -135,7 +136,7 @@ fn pick_best<'a>(l: SyntaxToken<'a>, r: SyntaxToken<'a>) -> SyntaxToken<'a> {
|
|||
fn priority(n: SyntaxToken) -> usize {
|
||||
match n.kind() {
|
||||
WHITESPACE => 0,
|
||||
IDENT | SELF_KW | SUPER_KW | CRATE_KW | LIFETIME => 2,
|
||||
IDENT | T![self] | T![super] | T![crate] | LIFETIME => 2,
|
||||
_ => 1,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue