Struct ide::RootDatabase
source · pub struct RootDatabase { /* private fields */ }
Implementations§
source§impl RootDatabase
impl RootDatabase
pub fn request_cancellation(&mut self)
pub fn apply_change(&mut self, change: ChangeWithProcMacros)
pub fn per_query_memory_usage(&mut self) -> Vec<(String, Bytes, usize)>
source§impl RootDatabase
impl RootDatabase
pub fn new(lru_capacity: Option<u16>) -> RootDatabase
pub fn enable_proc_attr_macros(&mut self)
pub fn update_base_query_lru_capacities(&mut self, lru_capacity: Option<u16>)
pub fn update_lru_capacities( &mut self, lru_capacities: &HashMap<Box<str>, u16, FxBuildHasher>, )
Trait Implementations§
source§impl Database for RootDatabase
impl Database for RootDatabase
§fn salsa_event(&self, event_fn: Event)
fn salsa_event(&self, event_fn: Event)
This function is invoked at key points in the salsa
runtime. It permits the database to be customized and to
inject logging or other custom behavior.
§fn unwind_if_cancelled(&self)
fn unwind_if_cancelled(&self)
Starts unwinding the stack if the current revision is cancelled. Read more
§fn salsa_runtime(&self) -> &Runtime
fn salsa_runtime(&self) -> &Runtime
Gives access to the underlying salsa runtime. Read more
§fn synthetic_write(&mut self, durability: Durability)
fn synthetic_write(&mut self, durability: Durability)
A “synthetic write” causes the system to act as though some
input of durability
durability
has changed. This is mostly
useful for profiling scenarios. Read moresource§impl Debug for RootDatabase
impl Debug for RootDatabase
source§impl Default for RootDatabase
impl Default for RootDatabase
source§fn default() -> RootDatabase
fn default() -> RootDatabase
Returns the “default value” for a type. Read more
source§impl Drop for RootDatabase
impl Drop for RootDatabase
source§impl FileLoader for RootDatabase
impl FileLoader for RootDatabase
fn resolve_path(&self, path: AnchoredPath<'_>) -> Option<FileId>
source§fn relevant_crates(&self, file_id: FileId) -> Arc<[Idx<CrateData>]>
fn relevant_crates(&self, file_id: FileId) -> Arc<[Idx<CrateData>]>
Crates whose root’s source root is the same as the source root of
file_id
source§impl ParallelDatabase for RootDatabase
impl ParallelDatabase for RootDatabase
source§impl Upcast<dyn DefDatabase> for RootDatabase
impl Upcast<dyn DefDatabase> for RootDatabase
fn upcast(&self) -> &(dyn DefDatabase + 'static)
source§impl Upcast<dyn ExpandDatabase> for RootDatabase
impl Upcast<dyn ExpandDatabase> for RootDatabase
fn upcast(&self) -> &(dyn ExpandDatabase + 'static)
source§impl Upcast<dyn HirDatabase> for RootDatabase
impl Upcast<dyn HirDatabase> for RootDatabase
fn upcast(&self) -> &(dyn HirDatabase + 'static)
Auto Trait Implementations§
impl !Freeze for RootDatabase
impl RefUnwindSafe for RootDatabase
impl Send for RootDatabase
impl !Sync for RootDatabase
impl Unpin for RootDatabase
impl UnwindSafe for RootDatabase
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Cast for T
impl<T> Cast for T
source§impl<DB> DefDatabase for DBwhere
DB: InternDatabase + ExpandDatabase + Upcast<dyn ExpandDatabase> + Database + HasQueryGroup<DefDatabaseStorage>,
impl<DB> DefDatabase for DBwhere
DB: InternDatabase + ExpandDatabase + Upcast<dyn ExpandDatabase> + Database + HasQueryGroup<DefDatabaseStorage>,
source§fn expand_proc_attr_macros(&self) -> bool
fn expand_proc_attr_macros(&self) -> bool
Whether to expand procedural macros during name resolution.
source§fn set_expand_proc_attr_macros(&mut self, value__: bool)
fn set_expand_proc_attr_macros(&mut self, value__: bool)
Set the value of the
expand_proc_attr_macros
input. Read moresource§fn set_expand_proc_attr_macros_with_durability(
&mut self,
value__: bool,
durability__: Durability,
)
fn set_expand_proc_attr_macros_with_durability( &mut self, value__: bool, durability__: Durability, )
Set the value of the
expand_proc_attr_macros
input with a
specific durability instead of the default of
Durability::LOW
. You can use Durability::MAX
to promise that its value will never change again. Read moresource§fn file_item_tree(&self, file_id: HirFileId) -> Arc<ItemTree>
fn file_item_tree(&self, file_id: HirFileId) -> Arc<ItemTree>
Computes an
ItemTree
for the given file or macro expansion.fn block_item_tree(&self, block_id: BlockId) -> Arc<ItemTree>
fn file_item_tree_with_source_map( &self, file_id: HirFileId, ) -> (Arc<ItemTree>, Arc<ItemTreeSourceMaps>)
fn block_item_tree_with_source_map( &self, block_id: BlockId, ) -> (Arc<ItemTree>, Arc<ItemTreeSourceMaps>)
fn crate_def_map(&self, krate: Idx<CrateData>) -> Arc<DefMap>
source§fn block_def_map(&self, block: BlockId) -> Arc<DefMap>
fn block_def_map(&self, block: BlockId) -> Arc<DefMap>
Computes the block-level
DefMap
.source§fn macro_def(&self, m: MacroId) -> MacroDefId
fn macro_def(&self, m: MacroId) -> MacroDefId
Turns a MacroId into a MacroDefId, describing the macro’s definition post name resolution.
fn struct_data(&self, id: StructId) -> Arc<StructData>
fn struct_data_with_diagnostics( &self, id: StructId, ) -> (Arc<StructData>, DefDiagnostics)
fn union_data(&self, id: UnionId) -> Arc<StructData>
fn union_data_with_diagnostics( &self, id: UnionId, ) -> (Arc<StructData>, DefDiagnostics)
fn enum_data(&self, e: EnumId) -> Arc<EnumData>
fn enum_variant_data(&self, id: EnumVariantId) -> Arc<EnumVariantData>
fn enum_variant_data_with_diagnostics( &self, id: EnumVariantId, ) -> (Arc<EnumVariantData>, DefDiagnostics)
fn variant_data(&self, id: VariantId) -> Arc<VariantData>
fn impl_data(&self, e: ImplId) -> Arc<ImplData>
fn impl_data_with_diagnostics( &self, e: ImplId, ) -> (Arc<ImplData>, DefDiagnostics)
fn trait_data(&self, e: TraitId) -> Arc<TraitData>
fn trait_data_with_diagnostics( &self, tr: TraitId, ) -> (Arc<TraitData>, DefDiagnostics)
fn trait_alias_data(&self, e: TraitAliasId) -> Arc<TraitAliasData>
fn type_alias_data(&self, e: TypeAliasId) -> Arc<TypeAliasData>
fn function_data(&self, func: FunctionId) -> Arc<FunctionData>
fn const_data(&self, konst: ConstId) -> Arc<ConstData>
fn static_data(&self, statik: StaticId) -> Arc<StaticData>
fn macro2_data(&self, makro: Macro2Id) -> Arc<Macro2Data>
fn macro_rules_data(&self, makro: MacroRulesId) -> Arc<MacroRulesData>
fn proc_macro_data(&self, makro: ProcMacroId) -> Arc<ProcMacroData>
fn extern_crate_decl_data( &self, extern_crate: ExternCrateId, ) -> Arc<ExternCrateDeclData>
fn body_with_source_map( &self, def: DefWithBodyId, ) -> (Arc<Body>, Arc<BodySourceMap>)
fn body(&self, def: DefWithBodyId) -> Arc<Body>
fn expr_scopes(&self, def: DefWithBodyId) -> Arc<ExprScopes>
fn generic_params(&self, def: GenericDefId) -> Arc<GenericParams>
source§fn generic_params_with_source_map(
&self,
def: GenericDefId,
) -> (Arc<GenericParams>, Option<Arc<TypesSourceMap>>)
fn generic_params_with_source_map( &self, def: GenericDefId, ) -> (Arc<GenericParams>, Option<Arc<TypesSourceMap>>)
If this returns
None
for the source map, that means it is the same as with the item tree.fn fields_attrs(&self, def: VariantId) -> Arc<ArenaMap<Idx<FieldData>, Attrs>>
fn fields_attrs_source_map( &self, def: VariantId, ) -> Arc<ArenaMap<Idx<FieldData>, AstPtr<Either<TupleField, RecordField>>>>
fn attrs(&self, def: AttrDefId) -> Attrs
fn lang_attr(&self, def: AttrDefId) -> Option<LangItem>
fn lang_item( &self, start_crate: Idx<CrateData>, item: LangItem, ) -> Option<LangItemTarget>
fn import_map(&self, krate: Idx<CrateData>) -> Arc<ImportMap>
fn field_visibilities( &self, var: VariantId, ) -> Arc<ArenaMap<Idx<FieldData>, Visibility>>
fn function_visibility(&self, def: FunctionId) -> Visibility
fn const_visibility(&self, def: ConstId) -> Visibility
fn crate_lang_items(&self, krate: Idx<CrateData>) -> Option<Arc<LangItems>>
fn notable_traits_in_deps(&self, krate: Idx<CrateData>) -> Arc<[Arc<[TraitId]>]>
fn crate_notable_traits(&self, krate: Idx<CrateData>) -> Option<Arc<[TraitId]>>
fn crate_supports_no_std(&self, crate_id: Idx<CrateData>) -> bool
fn include_macro_invoc( &self, crate_id: Idx<CrateData>, ) -> Arc<[(MacroCallId, EditionedFileId)]>
source§impl<DB> ExpandDatabase for DBwhere
DB: SourceDatabase + Database + HasQueryGroup<ExpandDatabaseStorage>,
impl<DB> ExpandDatabase for DBwhere
DB: SourceDatabase + Database + HasQueryGroup<ExpandDatabaseStorage>,
source§fn proc_macros(&self) -> Arc<ProcMacros>
fn proc_macros(&self) -> Arc<ProcMacros>
The proc macros.
source§fn set_proc_macros(&mut self, value__: Arc<ProcMacros>)
fn set_proc_macros(&mut self, value__: Arc<ProcMacros>)
Set the value of the
proc_macros
input. Read moresource§fn set_proc_macros_with_durability(
&mut self,
value__: Arc<ProcMacros>,
durability__: Durability,
)
fn set_proc_macros_with_durability( &mut self, value__: Arc<ProcMacros>, durability__: Durability, )
Set the value of the
proc_macros
input with a
specific durability instead of the default of
Durability::LOW
. You can use Durability::MAX
to promise that its value will never change again. Read morefn ast_id_map(&self, file_id: HirFileId) -> Arc<AstIdMap>
source§fn parse_or_expand(&self, file_id: HirFileId) -> SyntaxNode<RustLanguage>
fn parse_or_expand(&self, file_id: HirFileId) -> SyntaxNode<RustLanguage>
Main public API – parses a hir file, not caring whether it’s a real
file or a macro expansion.
source§fn parse_macro_expansion(
&self,
macro_file: MacroFileId,
) -> ValueResult<(Parse<SyntaxNode<RustLanguage>>, Arc<SpanMap<SyntaxContextId>>), ExpandError>
fn parse_macro_expansion( &self, macro_file: MacroFileId, ) -> ValueResult<(Parse<SyntaxNode<RustLanguage>>, Arc<SpanMap<SyntaxContextId>>), ExpandError>
Implementation for the macro case.
fn span_map(&self, file_id: HirFileId) -> SpanMap
fn expansion_span_map( &self, file_id: MacroFileId, ) -> Arc<SpanMap<SyntaxContextId>>
fn real_span_map(&self, file_id: EditionedFileId) -> Arc<RealSpanMap>
source§fn intern_macro_call(&self, macro_call: MacroCallLoc) -> MacroCallId
fn intern_macro_call(&self, macro_call: MacroCallLoc) -> MacroCallId
Macro ids. That’s probably the tricksiest bit in rust-analyzer, and the
reason why we use salsa at all. Read more
fn lookup_intern_macro_call(&self, key: MacroCallId) -> MacroCallLoc
fn intern_syntax_context(&self, ctx: SyntaxContextData) -> SyntaxContextId
fn lookup_intern_syntax_context( &self, key: SyntaxContextId, ) -> SyntaxContextData
fn setup_syntax_context_root(&self)
fn dump_syntax_contexts(&self) -> String
source§fn macro_arg(
&self,
id: MacroCallId,
) -> (Arc<Subtree<SpanData<SyntaxContextId>>>, SyntaxFixupUndoInfo, SpanData<SyntaxContextId>)
fn macro_arg( &self, id: MacroCallId, ) -> (Arc<Subtree<SpanData<SyntaxContextId>>>, SyntaxFixupUndoInfo, SpanData<SyntaxContextId>)
👎Deprecated: calling this is incorrect, call
macro_arg_considering_derives
insteadLowers syntactic macro call to a token tree representation. That’s a firewall
query, only typing in the macro call itself changes the returned
subtree.
fn macro_arg_considering_derives( &self, id: MacroCallId, kind: &MacroCallKind, ) -> (Arc<Subtree<SpanData<SyntaxContextId>>>, SyntaxFixupUndoInfo, SpanData<SyntaxContextId>)
source§fn macro_expander(&self, id: MacroDefId) -> TokenExpander
fn macro_expander(&self, id: MacroDefId) -> TokenExpander
Fetches the expander for this macro.
source§fn decl_macro_expander(
&self,
def_crate: Idx<CrateData>,
id: InFileWrapper<HirFileId, FileAstId<Macro>>,
) -> Arc<DeclarativeMacroExpander>
fn decl_macro_expander( &self, def_crate: Idx<CrateData>, id: InFileWrapper<HirFileId, FileAstId<Macro>>, ) -> Arc<DeclarativeMacroExpander>
Fetches (and compiles) the expander of this decl macro.
source§fn expand_proc_macro(
&self,
call: MacroCallId,
) -> ValueResult<Arc<Subtree<SpanData<SyntaxContextId>>>, ExpandError>
fn expand_proc_macro( &self, call: MacroCallId, ) -> ValueResult<Arc<Subtree<SpanData<SyntaxContextId>>>, ExpandError>
Special case of the previous query for procedural macros. We can’t LRU
proc macros, since they are not deterministic in general, and
non-determinism breaks salsa in a very, very, very bad way.
@edwin0cheng heroically debugged this once! See #4315 for details
source§fn proc_macro_span(
&self,
fun: InFileWrapper<HirFileId, FileAstId<Fn>>,
) -> SpanData<SyntaxContextId>
fn proc_macro_span( &self, fun: InFileWrapper<HirFileId, FileAstId<Fn>>, ) -> SpanData<SyntaxContextId>
Retrieves the span to be used for a proc-macro expansions spans.
This is a firewall query as it requires parsing the file, which we don’t want proc-macros to
directly depend on as that would cause to frequent invalidations, mainly because of the
parse queries being LRU cached. If they weren’t the invalidations would only happen if the
user wrote in the file that defines the proc-macro.
source§fn parse_macro_expansion_error(
&self,
macro_call: MacroCallId,
) -> Option<Arc<ValueResult<Arc<[SyntaxError]>, ExpandError>>>
fn parse_macro_expansion_error( &self, macro_call: MacroCallId, ) -> Option<Arc<ValueResult<Arc<[SyntaxError]>, ExpandError>>>
Firewall query that returns the errors from the
parse_macro_expansion
query.fn syntax_context(&self, file: HirFileId) -> SyntaxContextId
source§impl<DB> HirDatabase for DB
impl<DB> HirDatabase for DB
fn infer(&self, def: DefWithBodyId) -> Arc<InferenceResult>
fn mir_body(&self, def: DefWithBodyId) -> Result<Arc<MirBody>, MirLowerError>
fn mir_body_for_closure( &self, def: ClosureId<Interner>, ) -> Result<Arc<MirBody>, MirLowerError>
fn monomorphized_mir_body( &self, def: DefWithBodyId, subst: Substitution<Interner>, env: Arc<TraitEnvironment>, ) -> Result<Arc<MirBody>, MirLowerError>
fn monomorphized_mir_body_for_closure( &self, def: ClosureId<Interner>, subst: Substitution<Interner>, env: Arc<TraitEnvironment>, ) -> Result<Arc<MirBody>, MirLowerError>
fn borrowck( &self, def: DefWithBodyId, ) -> Result<Arc<[BorrowckResult]>, MirLowerError>
fn const_eval( &self, def: GeneralConstId, subst: Substitution<Interner>, trait_env: Option<Arc<TraitEnvironment>>, ) -> Result<Const<Interner>, ConstEvalError>
fn const_eval_static( &self, def: StaticId, ) -> Result<Const<Interner>, ConstEvalError>
fn const_eval_discriminant( &self, def: EnumVariantId, ) -> Result<i128, ConstEvalError>
fn lookup_impl_method( &self, env: Arc<TraitEnvironment>, func: FunctionId, fn_subst: Substitution<Interner>, ) -> (FunctionId, Substitution<Interner>)
fn layout_of_adt( &self, def: AdtId, subst: Substitution<Interner>, env: Arc<TraitEnvironment>, ) -> Result<Arc<LayoutData<RustcFieldIdx, RustcEnumVariantIdx>>, LayoutError>
fn layout_of_ty( &self, ty: Ty<Interner>, env: Arc<TraitEnvironment>, ) -> Result<Arc<LayoutData<RustcFieldIdx, RustcEnumVariantIdx>>, LayoutError>
fn target_data_layout( &self, krate: Idx<CrateData>, ) -> Result<Arc<TargetDataLayout>, Arc<str>>
fn dyn_compatibility_of_trait( &self, trait_: TraitId, ) -> Option<DynCompatibilityViolation>
fn ty(&self, def: TyDefId) -> Binders<Ty<Interner>>
source§fn value_ty(&self, def: ValueTyDefId) -> Option<Binders<Ty<Interner>>>
fn value_ty(&self, def: ValueTyDefId) -> Option<Binders<Ty<Interner>>>
Returns the type of the value of the given constant, or
None
if the ValueTyDefId
is
a StructId
or EnumVariantId
with a record constructor.fn impl_self_ty(&self, def: ImplId) -> Binders<Ty<Interner>>
fn const_param_ty(&self, def: ConstParamId) -> Ty<Interner>
fn impl_trait(&self, def: ImplId) -> Option<Binders<TraitRef<Interner>>>
fn field_types( &self, var: VariantId, ) -> Arc<ArenaMap<Idx<FieldData>, Binders<Ty<Interner>>>>
fn callable_item_signature(&self, def: CallableDefId) -> Binders<CallableSig>
fn return_type_impl_traits( &self, def: FunctionId, ) -> Option<Arc<Binders<ImplTraits>>>
fn type_alias_impl_traits( &self, def: TypeAliasId, ) -> Option<Arc<Binders<ImplTraits>>>
fn generic_predicates_for_param( &self, def: GenericDefId, param_id: TypeOrConstParamId, assoc_name: Option<Name>, ) -> GenericPredicates
fn generic_predicates(&self, def: GenericDefId) -> GenericPredicates
fn generic_predicates_without_parent( &self, def: GenericDefId, ) -> GenericPredicates
fn trait_environment_for_body( &self, def: DefWithBodyId, ) -> Arc<TraitEnvironment>
fn trait_environment(&self, def: GenericDefId) -> Arc<TraitEnvironment>
fn generic_defaults(&self, def: GenericDefId) -> GenericDefaults
fn inherent_impls_in_crate(&self, krate: Idx<CrateData>) -> Arc<InherentImpls>
fn inherent_impls_in_block(&self, block: BlockId) -> Option<Arc<InherentImpls>>
source§fn incoherent_inherent_impl_crates(
&self,
krate: Idx<CrateData>,
fp: TyFingerprint,
) -> SmallVec<[Idx<CrateData>; 2]>
fn incoherent_inherent_impl_crates( &self, krate: Idx<CrateData>, fp: TyFingerprint, ) -> SmallVec<[Idx<CrateData>; 2]>
Collects all crates in the dependency graph that have impls for the
given fingerprint. This is only used for primitive types and types
annotated with
rustc_has_incoherent_inherent_impls
; for other types
we just look at the crate where the type is defined.fn trait_impls_in_crate(&self, krate: Idx<CrateData>) -> Arc<TraitImpls>
fn trait_impls_in_block(&self, block: BlockId) -> Option<Arc<TraitImpls>>
fn trait_impls_in_deps(&self, krate: Idx<CrateData>) -> Arc<[Arc<TraitImpls>]>
fn intern_callable_def( &self, callable_def: CallableDefId, ) -> InternedCallableDefId
fn lookup_intern_callable_def( &self, key: InternedCallableDefId, ) -> CallableDefId
fn intern_type_or_const_param_id( &self, param_id: TypeOrConstParamId, ) -> InternedTypeOrConstParamId
fn lookup_intern_type_or_const_param_id( &self, key: InternedTypeOrConstParamId, ) -> TypeOrConstParamId
fn intern_lifetime_param_id( &self, param_id: LifetimeParamId, ) -> InternedLifetimeParamId
fn lookup_intern_lifetime_param_id( &self, key: InternedLifetimeParamId, ) -> LifetimeParamId
fn intern_impl_trait_id(&self, id: ImplTraitId) -> InternedOpaqueTyId
fn lookup_intern_impl_trait_id(&self, key: InternedOpaqueTyId) -> ImplTraitId
fn intern_closure(&self, id: InternedClosure) -> InternedClosureId
fn lookup_intern_closure(&self, key: InternedClosureId) -> InternedClosure
fn intern_coroutine(&self, id: InternedCoroutine) -> InternedCoroutineId
fn lookup_intern_coroutine(&self, key: InternedCoroutineId) -> InternedCoroutine
fn associated_ty_data( &self, id: AssocTypeId<Interner>, ) -> Arc<AssociatedTyDatum<Interner>>
fn trait_datum( &self, krate: Idx<CrateData>, trait_id: TraitId<Interner>, ) -> Arc<TraitDatum<Interner>>
fn adt_datum( &self, krate: Idx<CrateData>, struct_id: AdtId<Interner>, ) -> Arc<AdtDatum<Interner>>
fn impl_datum( &self, krate: Idx<CrateData>, impl_id: ImplId<Interner>, ) -> Arc<ImplDatum<Interner>>
fn fn_def_datum( &self, fn_def_id: FnDefId<Interner>, ) -> Arc<FnDefDatum<Interner>>
fn fn_def_variance(&self, fn_def_id: FnDefId<Interner>) -> Variances<Interner>
fn adt_variance(&self, adt_id: AdtId<Interner>) -> Variances<Interner>
fn associated_ty_value( &self, krate: Idx<CrateData>, id: AssociatedTyValueId<Interner>, ) -> Arc<AssociatedTyValue<Interner>>
fn normalize_projection( &self, projection: ProjectionTy<Interner>, env: Arc<TraitEnvironment>, ) -> Ty<Interner>
fn trait_solve( &self, krate: Idx<CrateData>, block: Option<BlockId>, goal: Canonical<InEnvironment<Goal<Interner>>>, ) -> Option<Solution<Interner>>
fn program_clauses_for_chalk_env( &self, krate: Idx<CrateData>, block: Option<BlockId>, env: Environment<Interner>, ) -> ProgramClauses<Interner>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<DB> InternDatabase for DBwhere
DB: SourceDatabase + Database + HasQueryGroup<InternDatabaseStorage>,
impl<DB> InternDatabase for DBwhere
DB: SourceDatabase + Database + HasQueryGroup<InternDatabaseStorage>,
fn intern_use(&self, loc: ItemLoc<Use>) -> UseId
fn lookup_intern_use(&self, key: UseId) -> ItemLoc<Use>
fn intern_extern_crate(&self, loc: ItemLoc<ExternCrate>) -> ExternCrateId
fn lookup_intern_extern_crate(&self, key: ExternCrateId) -> ItemLoc<ExternCrate>
fn intern_function(&self, loc: AssocItemLoc<Function>) -> FunctionId
fn lookup_intern_function(&self, key: FunctionId) -> AssocItemLoc<Function>
fn intern_struct(&self, loc: ItemLoc<Struct>) -> StructId
fn lookup_intern_struct(&self, key: StructId) -> ItemLoc<Struct>
fn intern_union(&self, loc: ItemLoc<Union>) -> UnionId
fn lookup_intern_union(&self, key: UnionId) -> ItemLoc<Union>
fn intern_enum(&self, loc: ItemLoc<Enum>) -> EnumId
fn lookup_intern_enum(&self, key: EnumId) -> ItemLoc<Enum>
fn intern_enum_variant(&self, loc: EnumVariantLoc) -> EnumVariantId
fn lookup_intern_enum_variant(&self, key: EnumVariantId) -> EnumVariantLoc
fn intern_const(&self, loc: AssocItemLoc<Const>) -> ConstId
fn lookup_intern_const(&self, key: ConstId) -> AssocItemLoc<Const>
fn intern_static(&self, loc: AssocItemLoc<Static>) -> StaticId
fn lookup_intern_static(&self, key: StaticId) -> AssocItemLoc<Static>
fn intern_trait(&self, loc: ItemLoc<Trait>) -> TraitId
fn lookup_intern_trait(&self, key: TraitId) -> ItemLoc<Trait>
fn intern_trait_alias(&self, loc: ItemLoc<TraitAlias>) -> TraitAliasId
fn lookup_intern_trait_alias(&self, key: TraitAliasId) -> ItemLoc<TraitAlias>
fn intern_type_alias(&self, loc: AssocItemLoc<TypeAlias>) -> TypeAliasId
fn lookup_intern_type_alias(&self, key: TypeAliasId) -> AssocItemLoc<TypeAlias>
fn intern_impl(&self, loc: ItemLoc<Impl>) -> ImplId
fn lookup_intern_impl(&self, key: ImplId) -> ItemLoc<Impl>
fn intern_extern_block(&self, loc: ItemLoc<ExternBlock>) -> ExternBlockId
fn lookup_intern_extern_block(&self, key: ExternBlockId) -> ItemLoc<ExternBlock>
fn intern_macro2(&self, loc: Macro2Loc) -> Macro2Id
fn lookup_intern_macro2(&self, key: Macro2Id) -> Macro2Loc
fn intern_proc_macro(&self, loc: ProcMacroLoc) -> ProcMacroId
fn lookup_intern_proc_macro(&self, key: ProcMacroId) -> ProcMacroLoc
fn intern_macro_rules(&self, loc: MacroRulesLoc) -> MacroRulesId
fn lookup_intern_macro_rules(&self, key: MacroRulesId) -> MacroRulesLoc
fn intern_block(&self, loc: BlockLoc) -> BlockId
fn lookup_intern_block(&self, key: BlockId) -> BlockLoc
fn intern_anonymous_const(&self, id: ConstBlockLoc) -> ConstBlockId
fn lookup_intern_anonymous_const(&self, key: ConstBlockId) -> ConstBlockLoc
fn intern_in_type_const(&self, id: InTypeConstLoc) -> InTypeConstId
fn lookup_intern_in_type_const(&self, key: InTypeConstId) -> InTypeConstLoc
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<DB> LineIndexDatabase for DBwhere
DB: SourceDatabase + Database + HasQueryGroup<LineIndexDatabaseStorage>,
impl<DB> LineIndexDatabase for DBwhere
DB: SourceDatabase + Database + HasQueryGroup<LineIndexDatabaseStorage>,
fn line_index(&self, file_id: FileId) -> Arc<LineIndex>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<DB> SourceDatabase for DBwhere
DB: FileLoader + Debug + Database + HasQueryGroup<SourceDatabaseStorage>,
impl<DB> SourceDatabase for DBwhere
DB: FileLoader + Debug + Database + HasQueryGroup<SourceDatabaseStorage>,
fn compressed_file_text(&self, file_id: FileId) -> Arc<[u8]>
§fn set_compressed_file_text(&mut self, file_id: FileId, value__: Arc<[u8]>)
fn set_compressed_file_text(&mut self, file_id: FileId, value__: Arc<[u8]>)
Set the value of the
compressed_file_text
input. Read more§fn set_compressed_file_text_with_durability(
&mut self,
file_id: FileId,
value__: Arc<[u8]>,
durability__: Durability,
)
fn set_compressed_file_text_with_durability( &mut self, file_id: FileId, value__: Arc<[u8]>, durability__: Durability, )
Set the value of the
compressed_file_text
input with a
specific durability instead of the default of
Durability::LOW
. You can use Durability::MAX
to promise that its value will never change again. Read more§fn parse(&self, file_id: EditionedFileId) -> Parse<SourceFile>
fn parse(&self, file_id: EditionedFileId) -> Parse<SourceFile>
Parses the file into the syntax tree.
§fn parse_errors(&self, file_id: EditionedFileId) -> Option<Arc<[SyntaxError]>>
fn parse_errors(&self, file_id: EditionedFileId) -> Option<Arc<[SyntaxError]>>
Returns the set of errors obtained from parsing the file including validation errors.
§fn crate_graph(&self) -> Arc<CrateGraph>
fn crate_graph(&self) -> Arc<CrateGraph>
The crate graph.
§fn set_crate_graph(&mut self, value__: Arc<CrateGraph>)
fn set_crate_graph(&mut self, value__: Arc<CrateGraph>)
Set the value of the
crate_graph
input. Read more§fn set_crate_graph_with_durability(
&mut self,
value__: Arc<CrateGraph>,
durability__: Durability,
)
fn set_crate_graph_with_durability( &mut self, value__: Arc<CrateGraph>, durability__: Durability, )
Set the value of the
crate_graph
input with a
specific durability instead of the default of
Durability::LOW
. You can use Durability::MAX
to promise that its value will never change again. Read morefn crate_workspace_data( &self, ) -> Arc<HashMap<Idx<CrateData>, Arc<CrateWorkspaceData>, FxBuildHasher>>
§fn set_crate_workspace_data(
&mut self,
value__: Arc<HashMap<Idx<CrateData>, Arc<CrateWorkspaceData>, FxBuildHasher>>,
)
fn set_crate_workspace_data( &mut self, value__: Arc<HashMap<Idx<CrateData>, Arc<CrateWorkspaceData>, FxBuildHasher>>, )
Set the value of the
crate_workspace_data
input. Read more§fn set_crate_workspace_data_with_durability(
&mut self,
value__: Arc<HashMap<Idx<CrateData>, Arc<CrateWorkspaceData>, FxBuildHasher>>,
durability__: Durability,
)
fn set_crate_workspace_data_with_durability( &mut self, value__: Arc<HashMap<Idx<CrateData>, Arc<CrateWorkspaceData>, FxBuildHasher>>, durability__: Durability, )
Set the value of the
crate_workspace_data
input with a
specific durability instead of the default of
Durability::LOW
. You can use Durability::MAX
to promise that its value will never change again. Read morefn toolchain_channel(&self, krate: Idx<CrateData>) -> Option<ReleaseChannel>
§impl<Db> SourceDatabaseFileInputExt for Dbwhere
Db: SourceRootDatabase + ?Sized,
impl<Db> SourceDatabaseFileInputExt for Dbwhere
Db: SourceRootDatabase + ?Sized,
fn set_file_text_with_durability( &mut self, file_id: FileId, text: &str, durability: Durability, )
fn set_file_text(&mut self, file_id: FileId, text: &str)
§impl<DB> SourceRootDatabase for DBwhere
DB: SourceDatabase + Database + HasQueryGroup<SourceRootDatabaseStorage>,
impl<DB> SourceRootDatabase for DBwhere
DB: SourceDatabase + Database + HasQueryGroup<SourceRootDatabaseStorage>,
§fn file_source_root(&self, file_id: FileId) -> SourceRootId
fn file_source_root(&self, file_id: FileId) -> SourceRootId
Path to a file, relative to the root of its source root.
Source root of the file.
§fn set_file_source_root(&mut self, file_id: FileId, value__: SourceRootId)
fn set_file_source_root(&mut self, file_id: FileId, value__: SourceRootId)
Set the value of the
file_source_root
input. Read more§fn set_file_source_root_with_durability(
&mut self,
file_id: FileId,
value__: SourceRootId,
durability__: Durability,
)
fn set_file_source_root_with_durability( &mut self, file_id: FileId, value__: SourceRootId, durability__: Durability, )
Set the value of the
file_source_root
input with a
specific durability instead of the default of
Durability::LOW
. You can use Durability::MAX
to promise that its value will never change again. Read more§fn source_root(&self, id: SourceRootId) -> Arc<SourceRoot>
fn source_root(&self, id: SourceRootId) -> Arc<SourceRoot>
Contents of the source root.
§fn set_source_root(&mut self, id: SourceRootId, value__: Arc<SourceRoot>)
fn set_source_root(&mut self, id: SourceRootId, value__: Arc<SourceRoot>)
Set the value of the
source_root
input. Read more§fn set_source_root_with_durability(
&mut self,
id: SourceRootId,
value__: Arc<SourceRoot>,
durability__: Durability,
)
fn set_source_root_with_durability( &mut self, id: SourceRootId, value__: Arc<SourceRoot>, durability__: Durability, )
Set the value of the
source_root
input with a
specific durability instead of the default of
Durability::LOW
. You can use Durability::MAX
to promise that its value will never change again. Read more§fn source_root_crates(&self, id: SourceRootId) -> Arc<[Idx<CrateData>]>
fn source_root_crates(&self, id: SourceRootId) -> Arc<[Idx<CrateData>]>
Crates whose root fool is in
id
.source§impl<DB> SymbolsDatabase for DBwhere
DB: HirDatabase + SourceRootDatabase + Upcast<dyn HirDatabase> + Database + HasQueryGroup<SymbolsDatabaseStorage>,
impl<DB> SymbolsDatabase for DBwhere
DB: HirDatabase + SourceRootDatabase + Upcast<dyn HirDatabase> + Database + HasQueryGroup<SymbolsDatabaseStorage>,
source§fn module_symbols(&self, module: Module) -> Arc<SymbolIndex>
fn module_symbols(&self, module: Module) -> Arc<SymbolIndex>
The symbol index for a given module. These modules should only be in source roots that
are inside local_roots.
source§fn library_symbols(&self, source_root_id: SourceRootId) -> Arc<SymbolIndex>
fn library_symbols(&self, source_root_id: SourceRootId) -> Arc<SymbolIndex>
The symbol index for a given source root within library_roots.
source§fn crate_symbols(&self, krate: Crate) -> Box<[Arc<SymbolIndex>]>
fn crate_symbols(&self, krate: Crate) -> Box<[Arc<SymbolIndex>]>
The symbol indices of modules that make up a given crate.
source§fn local_roots(&self) -> Arc<HashSet<SourceRootId, FxBuildHasher>>
fn local_roots(&self) -> Arc<HashSet<SourceRootId, FxBuildHasher>>
The set of “local” (that is, from the current workspace) roots.
Files in local roots are assumed to change frequently.
source§fn set_local_roots(
&mut self,
value__: Arc<HashSet<SourceRootId, FxBuildHasher>>,
)
fn set_local_roots( &mut self, value__: Arc<HashSet<SourceRootId, FxBuildHasher>>, )
Set the value of the
local_roots
input. Read moresource§fn set_local_roots_with_durability(
&mut self,
value__: Arc<HashSet<SourceRootId, FxBuildHasher>>,
durability__: Durability,
)
fn set_local_roots_with_durability( &mut self, value__: Arc<HashSet<SourceRootId, FxBuildHasher>>, durability__: Durability, )
Set the value of the
local_roots
input with a
specific durability instead of the default of
Durability::LOW
. You can use Durability::MAX
to promise that its value will never change again. Read moresource§fn library_roots(&self) -> Arc<HashSet<SourceRootId, FxBuildHasher>>
fn library_roots(&self) -> Arc<HashSet<SourceRootId, FxBuildHasher>>
The set of roots for crates.io libraries.
Files in libraries are assumed to never change.
source§fn set_library_roots(
&mut self,
value__: Arc<HashSet<SourceRootId, FxBuildHasher>>,
)
fn set_library_roots( &mut self, value__: Arc<HashSet<SourceRootId, FxBuildHasher>>, )
Set the value of the
library_roots
input. Read moresource§fn set_library_roots_with_durability(
&mut self,
value__: Arc<HashSet<SourceRootId, FxBuildHasher>>,
durability__: Durability,
)
fn set_library_roots_with_durability( &mut self, value__: Arc<HashSet<SourceRootId, FxBuildHasher>>, durability__: Durability, )
Set the value of the
library_roots
input with a
specific durability instead of the default of
Durability::LOW
. You can use Durability::MAX
to promise that its value will never change again. Read more