From 011c2127c897b6e409fcdc5bb073fe8fbe5e8ea2 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 17 Apr 2024 18:44:50 +0200 Subject: [PATCH] Update `per_query_memory_usage` query listing --- crates/hir/src/db.rs | 41 ++++++--- crates/ide-db/src/apply_change.rs | 148 +++++++++++++++++------------- 2 files changed, 110 insertions(+), 79 deletions(-) diff --git a/crates/hir/src/db.rs b/crates/hir/src/db.rs index 1d74f9a4bb..cb5f5b06ae 100644 --- a/crates/hir/src/db.rs +++ b/crates/hir/src/db.rs @@ -4,24 +4,35 @@ //! //! But we need this for at least LRU caching at the query level. pub use hir_def::db::{ - AttrsQuery, BlockDefMapQuery, BodyQuery, BodyWithSourceMapQuery, ConstDataQuery, - ConstVisibilityQuery, CrateLangItemsQuery, CrateSupportsNoStdQuery, DefDatabase, - DefDatabaseStorage, EnumDataQuery, EnumVariantDataWithDiagnosticsQuery, ExprScopesQuery, - ExternCrateDeclDataQuery, FieldVisibilitiesQuery, FieldsAttrsQuery, FieldsAttrsSourceMapQuery, - FileItemTreeQuery, FunctionDataQuery, FunctionVisibilityQuery, GenericParamsQuery, - ImplDataWithDiagnosticsQuery, ImportMapQuery, InternAnonymousConstQuery, InternBlockQuery, - InternConstQuery, InternDatabase, InternDatabaseStorage, InternEnumQuery, - InternExternBlockQuery, InternExternCrateQuery, InternFunctionQuery, InternImplQuery, - InternInTypeConstQuery, InternMacro2Query, InternMacroRulesQuery, InternProcMacroQuery, - InternStaticQuery, InternStructQuery, InternTraitAliasQuery, InternTraitQuery, - InternTypeAliasQuery, InternUnionQuery, InternUseQuery, LangItemQuery, Macro2DataQuery, - MacroRulesDataQuery, ProcMacroDataQuery, StaticDataQuery, StructDataWithDiagnosticsQuery, - TraitAliasDataQuery, TraitDataWithDiagnosticsQuery, TypeAliasDataQuery, - UnionDataWithDiagnosticsQuery, + AttrsQuery, BlockDefMapQuery, BlockItemTreeQuery, BodyQuery, BodyWithSourceMapQuery, + ConstDataQuery, ConstVisibilityQuery, CrateDefMapQuery, CrateLangItemsQuery, + CrateNotableTraitsQuery, CrateSupportsNoStdQuery, DefDatabase, DefDatabaseStorage, + EnumDataQuery, EnumVariantDataWithDiagnosticsQuery, ExprScopesQuery, ExternCrateDeclDataQuery, + FieldVisibilitiesQuery, FieldsAttrsQuery, FieldsAttrsSourceMapQuery, FileItemTreeQuery, + FunctionDataQuery, FunctionVisibilityQuery, GenericParamsQuery, ImplDataWithDiagnosticsQuery, + ImportMapQuery, InternAnonymousConstQuery, InternBlockQuery, InternConstQuery, InternDatabase, + InternDatabaseStorage, InternEnumQuery, InternExternBlockQuery, InternExternCrateQuery, + InternFunctionQuery, InternImplQuery, InternInTypeConstQuery, InternMacro2Query, + InternMacroRulesQuery, InternProcMacroQuery, InternStaticQuery, InternStructQuery, + InternTraitAliasQuery, InternTraitQuery, InternTypeAliasQuery, InternUnionQuery, + InternUseQuery, LangItemQuery, Macro2DataQuery, MacroRulesDataQuery, ProcMacroDataQuery, + StaticDataQuery, StructDataWithDiagnosticsQuery, TraitAliasDataQuery, + TraitDataWithDiagnosticsQuery, TypeAliasDataQuery, UnionDataWithDiagnosticsQuery, }; pub use hir_expand::db::{ AstIdMapQuery, DeclMacroExpanderQuery, ExpandDatabase, ExpandDatabaseStorage, ExpandProcMacroQuery, InternMacroCallQuery, InternSyntaxContextQuery, MacroArgQuery, ParseMacroExpansionErrorQuery, ParseMacroExpansionQuery, ProcMacrosQuery, RealSpanMapQuery, }; -pub use hir_ty::db::*; +pub use hir_ty::db::{ + AdtDatumQuery, AdtVarianceQuery, AssociatedTyDataQuery, AssociatedTyValueQuery, BorrowckQuery, + CallableItemSignatureQuery, ConstEvalDiscriminantQuery, ConstEvalQuery, ConstEvalStaticQuery, + ConstParamTyQuery, FieldTypesQuery, FnDefDatumQuery, FnDefVarianceQuery, GenericDefaultsQuery, + GenericPredicatesForParamQuery, GenericPredicatesQuery, HirDatabase, HirDatabaseStorage, + ImplDatumQuery, ImplSelfTyQuery, ImplTraitQuery, IncoherentInherentImplCratesQuery, + InherentImplsInBlockQuery, InherentImplsInCrateQuery, InternCallableDefQuery, + InternClosureQuery, InternCoroutineQuery, InternImplTraitIdQuery, InternLifetimeParamIdQuery, + InternTypeOrConstParamIdQuery, LayoutOfAdtQuery, MirBodyQuery, ProgramClausesForChalkEnvQuery, + ReturnTypeImplTraitsQuery, TargetDataLayoutQuery, TraitDatumQuery, TraitEnvironmentQuery, + TraitImplsInBlockQuery, TraitImplsInCrateQuery, TraitImplsInDepsQuery, TyQuery, ValueTyQuery, +}; diff --git a/crates/ide-db/src/apply_change.rs b/crates/ide-db/src/apply_change.rs index ec05f6d13d..ce9a5f0dd2 100644 --- a/crates/ide-db/src/apply_change.rs +++ b/crates/ide-db/src/apply_change.rs @@ -91,82 +91,101 @@ impl RootDatabase { crate::symbol_index::LocalRootsQuery crate::symbol_index::LibraryRootsQuery // HirDatabase - hir::db::MirBodyQuery - hir::db::BorrowckQuery - hir::db::TyQuery - hir::db::ValueTyQuery - hir::db::ImplSelfTyQuery - hir::db::ConstParamTyQuery - hir::db::ConstEvalQuery - hir::db::ConstEvalDiscriminantQuery - hir::db::ImplTraitQuery - hir::db::FieldTypesQuery - hir::db::LayoutOfAdtQuery - hir::db::TargetDataLayoutQuery - hir::db::CallableItemSignatureQuery - hir::db::ReturnTypeImplTraitsQuery - hir::db::GenericPredicatesForParamQuery - hir::db::GenericPredicatesQuery - hir::db::TraitEnvironmentQuery - hir::db::GenericDefaultsQuery - hir::db::InherentImplsInCrateQuery - hir::db::InherentImplsInBlockQuery - hir::db::IncoherentInherentImplCratesQuery - hir::db::TraitImplsInCrateQuery - hir::db::TraitImplsInBlockQuery - hir::db::TraitImplsInDepsQuery - hir::db::InternCallableDefQuery - hir::db::InternLifetimeParamIdQuery - hir::db::InternImplTraitIdQuery - hir::db::InternTypeOrConstParamIdQuery - hir::db::InternClosureQuery - hir::db::InternCoroutineQuery - hir::db::AssociatedTyDataQuery - hir::db::TraitDatumQuery hir::db::AdtDatumQuery - hir::db::ImplDatumQuery + hir::db::AdtVarianceQuery + hir::db::AssociatedTyDataQuery + hir::db::AssociatedTyValueQuery + hir::db::BorrowckQuery + hir::db::CallableItemSignatureQuery + hir::db::ConstEvalDiscriminantQuery + hir::db::ConstEvalQuery + hir::db::ConstEvalStaticQuery + hir::db::ConstParamTyQuery + hir::db::FieldTypesQuery hir::db::FnDefDatumQuery hir::db::FnDefVarianceQuery - hir::db::AdtVarianceQuery - hir::db::AssociatedTyValueQuery + hir::db::GenericDefaultsQuery + hir::db::GenericPredicatesForParamQuery + hir::db::GenericPredicatesQuery + hir::db::ImplDatumQuery + hir::db::ImplSelfTyQuery + hir::db::ImplTraitQuery + hir::db::IncoherentInherentImplCratesQuery + hir::db::InherentImplsInBlockQuery + hir::db::InherentImplsInCrateQuery + hir::db::InternCallableDefQuery + hir::db::InternClosureQuery + hir::db::InternCoroutineQuery + hir::db::InternImplTraitIdQuery + hir::db::InternLifetimeParamIdQuery + hir::db::InternTypeOrConstParamIdQuery + hir::db::LayoutOfAdtQuery + hir::db::MirBodyQuery hir::db::ProgramClausesForChalkEnvQuery + hir::db::ReturnTypeImplTraitsQuery + hir::db::TargetDataLayoutQuery + hir::db::TraitDatumQuery + hir::db::TraitEnvironmentQuery + hir::db::TraitImplsInBlockQuery + hir::db::TraitImplsInCrateQuery + hir::db::TraitImplsInDepsQuery + hir::db::TyQuery + hir::db::ValueTyQuery // DefDatabase - hir::db::FileItemTreeQuery + hir::db::AttrsQuery hir::db::BlockDefMapQuery - hir::db::StructDataWithDiagnosticsQuery - hir::db::UnionDataWithDiagnosticsQuery + hir::db::BlockItemTreeQuery + hir::db::BodyQuery + hir::db::BodyWithSourceMapQuery + hir::db::ConstDataQuery + hir::db::ConstVisibilityQuery + hir::db::CrateDefMapQuery + hir::db::CrateLangItemsQuery + hir::db::CrateNotableTraitsQuery + hir::db::CrateSupportsNoStdQuery hir::db::EnumDataQuery hir::db::EnumVariantDataWithDiagnosticsQuery - hir::db::ImplDataWithDiagnosticsQuery - hir::db::TraitDataWithDiagnosticsQuery - hir::db::TraitAliasDataQuery - hir::db::TypeAliasDataQuery + hir::db::ExprScopesQuery + hir::db::ExternCrateDeclDataQuery + hir::db::FieldVisibilitiesQuery + hir::db::FieldsAttrsQuery + hir::db::FieldsAttrsSourceMapQuery + hir::db::FileItemTreeQuery hir::db::FunctionDataQuery - hir::db::ConstDataQuery - hir::db::StaticDataQuery + hir::db::FunctionVisibilityQuery + hir::db::GenericParamsQuery + hir::db::ImplDataWithDiagnosticsQuery + hir::db::ImportMapQuery + hir::db::InternAnonymousConstQuery + hir::db::InternBlockQuery + hir::db::InternConstQuery + hir::db::InternEnumQuery + hir::db::InternExternBlockQuery + hir::db::InternExternCrateQuery + hir::db::InternFunctionQuery + hir::db::InternImplQuery + hir::db::InternInTypeConstQuery + hir::db::InternMacro2Query + hir::db::InternMacroRulesQuery + hir::db::InternProcMacroQuery + hir::db::InternStaticQuery + hir::db::InternStructQuery + hir::db::InternTraitAliasQuery + hir::db::InternTraitQuery + hir::db::InternTypeAliasQuery + hir::db::InternUnionQuery + hir::db::InternUseQuery + hir::db::LangItemQuery hir::db::Macro2DataQuery hir::db::MacroRulesDataQuery hir::db::ProcMacroDataQuery - hir::db::BodyWithSourceMapQuery - hir::db::BodyQuery - hir::db::ExprScopesQuery - hir::db::GenericParamsQuery - hir::db::FieldsAttrsQuery - hir::db::FieldsAttrsSourceMapQuery - hir::db::AttrsQuery - hir::db::CrateLangItemsQuery - hir::db::LangItemQuery - hir::db::ImportMapQuery - hir::db::FieldVisibilitiesQuery - hir::db::FunctionVisibilityQuery - hir::db::ConstVisibilityQuery - hir::db::CrateSupportsNoStdQuery - hir::db::ExternCrateDeclDataQuery - hir::db::InternAnonymousConstQuery - hir::db::InternExternCrateQuery - hir::db::InternInTypeConstQuery - hir::db::InternUseQuery + hir::db::StaticDataQuery + hir::db::StructDataWithDiagnosticsQuery + hir::db::TraitAliasDataQuery + hir::db::TraitDataWithDiagnosticsQuery + hir::db::TypeAliasDataQuery + hir::db::UnionDataWithDiagnosticsQuery // InternDatabase hir::db::InternFunctionQuery @@ -192,9 +211,10 @@ impl RootDatabase { hir::db::InternMacroCallQuery hir::db::InternSyntaxContextQuery hir::db::MacroArgQuery + hir::db::ParseMacroExpansionErrorQuery hir::db::ParseMacroExpansionQuery - hir::db::RealSpanMapQuery hir::db::ProcMacrosQuery + hir::db::RealSpanMapQuery // LineIndexDatabase crate::LineIndexQuery