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 <christian.kandeler@qt.io>
This commit is contained in:
Ihor Ivlev
2022-05-07 00:44:03 +03:00
parent 5da36104ab
commit 6f7e7980d2
22 changed files with 271 additions and 32 deletions

View File

@@ -112,6 +112,11 @@ FormatDescriptions TextEditorSettingsPrivate::initialFormats()
tr("Highlighted search results inside the editor.\n"
"Used to mark write accesses to C++ symbols."),
FormatDescription::ShowBackgroundControl);
formatDescr.emplace_back(C_SEARCH_RESULT_CONTAINING_FUNCTION,
tr("Search Result Containing function"),
tr("Highlighted search results inside the editor.\n"
"Used to mark containing function of the symbol usage."),
FormatDescription::ShowForeAndBackgroundControl);
formatDescr.emplace_back(C_SEARCH_SCOPE, tr("Search Scope"),
tr("Section where the pattern is searched in."),
FormatDescription::ShowBackgroundControl);