mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Merge #1257
1257: Implemented tkn! macro for syntax kinds r=matklad a=pasa Implementation of #1248 Co-authored-by: Sergey Parilin <sergey.parilin@fxdd.com>
This commit is contained in:
commit
033a32f349
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