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

@@ -41,6 +41,7 @@ const char *nameForStyle(TextStyle style)
case C_SEARCH_RESULT: return "SearchResult";
case C_SEARCH_RESULT_ALT1: return "SearchResultAlt1";
case C_SEARCH_RESULT_ALT2: return "SearchResultAlt2";
case C_SEARCH_RESULT_CONTAINING_FUNCTION: return "SearchResultContainingFunction";
case C_SEARCH_SCOPE: return "SearchScope";
case C_PARENTHESES: return "Parentheses";
case C_PARENTHESES_MISMATCH:return "ParenthesesMismatch";