From 6f7e7980d2b604c79507f9165098f783db8ab2e3 Mon Sep 17 00:00:00 2001 From: Ihor Ivlev Date: Sat, 7 May 2022 00:44:03 +0300 Subject: [PATCH] Display parent functions in the Find Usages menu To display the parent function, first we find it in displayResults and store the information to SearchResultItem, then SearchResultTreeItemDelegate gets the information and renders it. Similar approach is applied to ClangdClient, in addSearchResultsForFile. This change also adds default style for containing function highlight in the search. Default foreground and background colors are same as usual text colors. Task-number: QTCREATORBUG-27550 Change-Id: Id1251afa192f8d1232524742b7c211770bcb83fb Reviewed-by: Christian Kandeler --- share/qtcreator/styles/creator-dark.xml | 1 + share/qtcreator/styles/dark.xml | 1 + share/qtcreator/styles/inkpot.xml | 1 + .../styles/modnokai_night_shift_v2.xml | 1 + share/qtcreator/styles/solarized-dark.xml | 1 + share/qtcreator/styles/solarized-light.xml | 1 + src/libs/cplusplus/CppDocument.cpp | 90 +++++++++++++++++-- src/plugins/clangcodemodel/clangdast.cpp | 6 ++ src/plugins/clangcodemodel/clangdast.h | 1 + src/plugins/clangcodemodel/clangdclient.cpp | 36 +++++++- .../coreplugin/find/searchresultcolor.h | 13 ++- .../coreplugin/find/searchresultitem.h | 9 ++ .../find/searchresulttreeitemdelegate.cpp | 62 ++++++++++--- .../find/searchresulttreeitemroles.h | 6 +- .../coreplugin/find/searchresulttreemodel.cpp | 9 ++ src/plugins/cppeditor/cppfindreferences.cpp | 39 +++++++- src/plugins/texteditor/fontsettingspage.cpp | 4 + src/plugins/texteditor/fontsettingspage.h | 1 + .../texteditor/texteditorconstants.cpp | 1 + src/plugins/texteditor/texteditorconstants.h | 2 +- src/plugins/texteditor/texteditorplugin.cpp | 13 ++- src/plugins/texteditor/texteditorsettings.cpp | 5 ++ 22 files changed, 271 insertions(+), 32 deletions(-) diff --git a/share/qtcreator/styles/creator-dark.xml b/share/qtcreator/styles/creator-dark.xml index b86483f30f7..6252c25a455 100644 --- a/share/qtcreator/styles/creator-dark.xml +++ b/share/qtcreator/styles/creator-dark.xml @@ -7,6 +7,7 @@