mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Don't complete values in type position
This commit is contained in:
parent
590472607c
commit
1d74ef1d98
8 changed files with 76 additions and 55 deletions
|
@ -2496,6 +2496,18 @@ impl ScopeDef {
|
|||
|
||||
items
|
||||
}
|
||||
|
||||
pub fn is_value_def(&self) -> bool {
|
||||
matches!(
|
||||
self,
|
||||
ScopeDef::ModuleDef(ModuleDef::Function(_))
|
||||
| ScopeDef::ModuleDef(ModuleDef::Variant(_))
|
||||
| ScopeDef::ModuleDef(ModuleDef::Const(_))
|
||||
| ScopeDef::ModuleDef(ModuleDef::Static(_))
|
||||
| ScopeDef::GenericParam(GenericParam::ConstParam(_))
|
||||
| ScopeDef::Local(_)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ItemInNs> for ScopeDef {
|
||||
|
|
|
@ -35,8 +35,9 @@ pub enum PathResolution {
|
|||
Def(ModuleDef),
|
||||
/// A local binding (only value namespace)
|
||||
Local(Local),
|
||||
/// A generic parameter
|
||||
/// A type parameter
|
||||
TypeParam(TypeParam),
|
||||
/// A const parameter
|
||||
ConstParam(ConstParam),
|
||||
SelfType(Impl),
|
||||
Macro(MacroDef),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue