mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Merge #11630
11630: fix: Recognize `Self` as a proper keyword r=Veykril a=Veykril Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11627 Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
commit
96c11f5fd6
39 changed files with 226 additions and 74 deletions
|
@ -5,7 +5,11 @@ use std::{
|
|||
iter,
|
||||
};
|
||||
|
||||
use crate::{db::AstDatabase, hygiene::Hygiene, name::Name};
|
||||
use crate::{
|
||||
db::AstDatabase,
|
||||
hygiene::Hygiene,
|
||||
name::{known, Name},
|
||||
};
|
||||
use base_db::CrateId;
|
||||
use either::Either;
|
||||
use syntax::{ast, AstNode};
|
||||
|
@ -162,6 +166,12 @@ fn convert_path(
|
|||
}
|
||||
}
|
||||
}
|
||||
ast::PathSegmentKind::SelfTypeKw => {
|
||||
if prefix.is_some() {
|
||||
return None;
|
||||
}
|
||||
ModPath::from_segments(PathKind::Plain, Some(known::SELF_TYPE))
|
||||
}
|
||||
ast::PathSegmentKind::CrateKw => {
|
||||
if prefix.is_some() {
|
||||
return None;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue