forked from qt-creator/qt-creator
Clang: Make diagnostic tooltips consistent
Fix that triggering a diagnostic tooltip from the diagnostic location/range itself (underlined text) did not show the icon on the left and the actions/toolbuttons on the right in the tooltip. Instead of showing the tooltip content itself, request the tooltip for the corresponding text mark to get the extra decoration and actions. Change-Id: I5e94aca117a761f7a798d4f4b33db6e386e54d84 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -48,7 +48,6 @@
|
||||
#include <cpptools/cppworkingcopy.h>
|
||||
#include <cpptools/editordocumenthandle.h>
|
||||
|
||||
#include <texteditor/displaysettings.h>
|
||||
#include <texteditor/fontsettings.h>
|
||||
#include <texteditor/texteditor.h>
|
||||
#include <texteditor/texteditorconstants.h>
|
||||
@@ -292,27 +291,6 @@ TextEditor::QuickFixOperations ClangEditorDocumentProcessor::extraRefactoringOpe
|
||||
return extractor.extract(assistInterface.fileName(), currentLine(assistInterface));
|
||||
}
|
||||
|
||||
bool ClangEditorDocumentProcessor::hasDiagnosticsAt(uint line, uint column) const
|
||||
{
|
||||
return m_diagnosticManager.hasDiagnosticsAt(line, column);
|
||||
}
|
||||
|
||||
void ClangEditorDocumentProcessor::addDiagnosticToolTipToLayout(uint line,
|
||||
uint column,
|
||||
QLayout *target) const
|
||||
{
|
||||
using Internal::ClangDiagnosticWidget;
|
||||
|
||||
const QVector<ClangBackEnd::DiagnosticContainer> diagnostics
|
||||
= m_diagnosticManager.diagnosticsAt(line, column);
|
||||
|
||||
target->addWidget(
|
||||
ClangDiagnosticWidget::createWidget(diagnostics, ClangDiagnosticWidget::ToolTip));
|
||||
auto link = TextEditor::DisplaySettings::createAnnotationSettingsLink();
|
||||
target->addWidget(link);
|
||||
target->setAlignment(link, Qt::AlignRight);
|
||||
}
|
||||
|
||||
void ClangEditorDocumentProcessor::editorDocumentTimerRestarted()
|
||||
{
|
||||
m_updateBackendDocumentTimer.stop(); // Wait for the next call to run().
|
||||
@@ -323,6 +301,12 @@ void ClangEditorDocumentProcessor::invalidateDiagnostics()
|
||||
m_diagnosticManager.invalidateDiagnostics();
|
||||
}
|
||||
|
||||
TextEditor::TextMarks ClangEditorDocumentProcessor::diagnosticTextMarksAt(uint line,
|
||||
uint column) const
|
||||
{
|
||||
return m_diagnosticManager.diagnosticTextMarksAt(line, column);
|
||||
}
|
||||
|
||||
void ClangEditorDocumentProcessor::setParserConfig(
|
||||
const CppTools::BaseEditorDocumentParser::Configuration &config)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user