mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
fix completion bugs
This commit is contained in:
parent
488326ffa7
commit
13d2fd32ab
30 changed files with 179 additions and 135 deletions
|
@ -143,6 +143,10 @@ impl Module {
|
|||
return PerNs::none();
|
||||
}
|
||||
}
|
||||
PathKind::Abs => {
|
||||
// TODO: absolute use is not supported
|
||||
return PerNs::none();
|
||||
}
|
||||
}
|
||||
.def_id,
|
||||
);
|
||||
|
|
|
@ -15,7 +15,8 @@
|
|||
//! so that the results of name resolution can be preserved unless the module
|
||||
//! structure itself is modified.
|
||||
pub(crate) mod lower;
|
||||
use lower::*;
|
||||
|
||||
use crate::nameres::lower::*;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
|
@ -59,7 +60,7 @@ impl ModuleScope {
|
|||
pub struct Resolution {
|
||||
/// None for unresolved
|
||||
pub def_id: PerNs<DefId>,
|
||||
/// ident by whitch this is imported into local scope.
|
||||
/// ident by which this is imported into local scope.
|
||||
pub import: Option<ImportId>,
|
||||
}
|
||||
|
||||
|
@ -317,6 +318,10 @@ where
|
|||
}
|
||||
}
|
||||
PathKind::Crate => module_id.crate_root(&self.module_tree),
|
||||
PathKind::Abs => {
|
||||
// TODO: absolute use is not supported for now
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
for (i, segment) in import.path.segments.iter().enumerate() {
|
||||
|
|
|
@ -38,6 +38,8 @@ pub enum PathKind {
|
|||
Self_,
|
||||
Super,
|
||||
Crate,
|
||||
// Absolute path
|
||||
Abs,
|
||||
}
|
||||
|
||||
impl Path {
|
||||
|
@ -57,6 +59,11 @@ impl Path {
|
|||
let mut segments = Vec::new();
|
||||
loop {
|
||||
let segment = path.segment()?;
|
||||
|
||||
if segment.has_colon_colon() {
|
||||
kind = PathKind::Abs;
|
||||
}
|
||||
|
||||
match segment.kind()? {
|
||||
ast::PathSegmentKind::Name(name) => {
|
||||
let args = segment
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue