From 269fc1fd6bd2ff373efab8ce75cb2576943f7bff Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 25 Jun 2024 15:25:56 +0200 Subject: [PATCH] LanguageClient: optimize call and type hierarchy Trigger a fetch from the can fetch function in order to get whether the item has children. This information is used to show the expansion marker for items that have children, and not for items that have not been fetched yet. Change-Id: Ifc20588aa805368369e72fc8501244f64bbbc91d Reviewed-by: hjk Reviewed-by: Christian Kandeler --- src/plugins/languageclient/callandtypehierarchy.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/languageclient/callandtypehierarchy.cpp b/src/plugins/languageclient/callandtypehierarchy.cpp index 3d2e9eff144..8cfc3578c37 100644 --- a/src/plugins/languageclient/callandtypehierarchy.cpp +++ b/src/plugins/languageclient/callandtypehierarchy.cpp @@ -76,7 +76,12 @@ protected: } private: - bool canFetchMore() const override { return m_client && !m_fetchedChildren; } + bool canFetchMore() const override + { + if (m_client && !m_fetchedChildren) + const_cast(this)->fetchMore(); + return false; + } void fetchMore() override { @@ -96,8 +101,6 @@ private: appendChild(new HierarchyItem(getSourceItem(item), m_client)); } } - if (!hasChildren()) - update(); }); m_client->sendMessage(request); }