From 0a4073ef90cb61400856ead7c137064096694b6a Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Thu, 18 Jan 2018 10:47:45 +0100 Subject: TextEditor: Return hover handler priority by callback ...to get rid of the asynchronous code path. Change-Id: I56377510440631b0be712333b2a4018717c86389 Reviewed-by: David Schulz --- src/plugins/clangrefactoring/clangqueryhoverhandler.cpp | 7 ++++++- src/plugins/clangrefactoring/clangqueryhoverhandler.h | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/plugins/clangrefactoring') diff --git a/src/plugins/clangrefactoring/clangqueryhoverhandler.cpp b/src/plugins/clangrefactoring/clangqueryhoverhandler.cpp index e8ce90c297..11a29f1db1 100644 --- a/src/plugins/clangrefactoring/clangqueryhoverhandler.cpp +++ b/src/plugins/clangrefactoring/clangqueryhoverhandler.cpp @@ -30,6 +30,7 @@ #include #include +#include namespace ClangRefactoring { @@ -38,8 +39,12 @@ ClangQueryHoverHandler::ClangQueryHoverHandler(ClangQueryHighlighter *highligher { } -void ClangQueryHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget, int position) +void ClangQueryHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget, + int position, + ReportPriority report) { + Utils::ExecuteOnDestruction reportPriority([this, report](){ report(priority()); }); + using Messages = ClangBackEnd::DynamicASTMatcherDiagnosticMessageContainers; using Contexts = ClangBackEnd::DynamicASTMatcherDiagnosticContextContainers; diff --git a/src/plugins/clangrefactoring/clangqueryhoverhandler.h b/src/plugins/clangrefactoring/clangqueryhoverhandler.h index 7a93bcbf5d..a9dfc5fe22 100644 --- a/src/plugins/clangrefactoring/clangqueryhoverhandler.h +++ b/src/plugins/clangrefactoring/clangqueryhoverhandler.h @@ -37,7 +37,9 @@ public: ClangQueryHoverHandler(ClangQueryHighlighter *highligher); protected: - void identifyMatch(TextEditor::TextEditorWidget *editorWidget, int position) override; + void identifyMatch(TextEditor::TextEditorWidget *editorWidget, + int position, + ReportPriority report) override; private: ClangQueryHighlighter *m_highligher; -- cgit v1.2.1