ClangCodeModel: Provide tooltips via clangd

Note that we temporarily lose the ability to hover over an include and
get the full path of the header file. This is a valuable feature that we
need to restore, preferably by fixing clangd itself.
Fixing the remaining few test failures would likely require more
complicated code as well as additional LSP round-trips, and as of now
I'm not convinced it is worth the effort.

Change-Id: I08c72c4bd1268bbd67baeb57bbfd29d9b11303a5
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-06-04 12:40:26 +02:00
parent eef0769d7a
commit 673d596c84
14 changed files with 651 additions and 9 deletions

View File

@@ -70,12 +70,17 @@ public:
void findLocalUsages(TextEditor::TextDocument *document, const QTextCursor &cursor,
CppTools::RefactoringEngineInterface::RenameCallback &&callback);
void gatherHelpItemForTooltip(
const LanguageServerProtocol::HoverRequest::Response &hoverResponse,
const LanguageServerProtocol::DocumentUri &uri);
void enableTesting();
signals:
void indexingFinished();
void foundReferences(const QList<Core::SearchResultItem> &items);
void findUsagesDone();
void helpItemGathered(const Core::HelpItem &helpItem);
private:
void handleDiagnostics(const LanguageServerProtocol::PublishDiagnosticsParams &params) override;