]> git.lizzy.rs Git - rust.git/blobdiff - crates/hir/src/semantics.rs
fix: insert whitespaces into assoc items for assist when macro generated
[rust.git] / crates / hir / src / semantics.rs
index c48bd1b053815b526b448aae6ed729487e7784df..75f6b025779587ec935b97b721005d16a043ba8f 100644 (file)
@@ -27,7 +27,7 @@
     source_analyzer::{resolve_hir_path, resolve_hir_path_as_macro, SourceAnalyzer},
     Access, AssocItem, BuiltinAttr, Callable, ConstParam, Crate, Field, Function, HasSource,
     HirFileId, Impl, InFile, Label, LifetimeParam, Local, MacroDef, Module, ModuleDef, Name, Path,
-    ScopeDef, Tool, Trait, Type, TypeAlias, TypeParam, VariantDef,
+    ScopeDef, ToolModule, Trait, Type, TypeAlias, TypeParam, VariantDef,
 };
 
 #[derive(Debug, Clone, PartialEq, Eq)]
@@ -44,7 +44,7 @@ pub enum PathResolution {
     Macro(MacroDef),
     AssocItem(AssocItem),
     BuiltinAttr(BuiltinAttr),
-    Tool(Tool),
+    ToolModule(ToolModule),
 }
 
 impl PathResolution {
@@ -66,7 +66,7 @@ fn in_type_ns(&self) -> Option<TypeNs> {
                 Some(TypeNs::TypeAliasId((*alias).into()))
             }
             PathResolution::BuiltinAttr(_)
-            | PathResolution::Tool(_)
+            | PathResolution::ToolModule(_)
             | PathResolution::Local(_)
             | PathResolution::Macro(_)
             | PathResolution::ConstParam(_) => None,
@@ -1164,8 +1164,7 @@ pub fn krate(&self) -> Option<Crate> {
     }
 
     /// Note: `FxHashSet<TraitId>` should be treated as an opaque type, passed into `Type
-    // FIXME: rename to visible_traits to not repeat scope?
-    pub fn traits_in_scope(&self) -> FxHashSet<TraitId> {
+    pub fn visible_traits(&self) -> FxHashSet<TraitId> {
         let resolver = &self.resolver;
         resolver.traits_in_scope(self.db.upcast())
     }