forked from qt-creator/qt-creator
Add fallback help IDs to built-in model
Task-number: QTCREATORBUG-15959 Change-Id: I1e022450d09cb0e8565573079e412b26d09ce662 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
#include "cpphoverhandler.h"
|
#include "cpphoverhandler.h"
|
||||||
|
|
||||||
#include "cppelementevaluator.h"
|
#include "cppelementevaluator.h"
|
||||||
|
#include "cpptoolsreuse.h"
|
||||||
|
|
||||||
#include <coreplugin/helpmanager.h>
|
#include <coreplugin/helpmanager.h>
|
||||||
#include <texteditor/texteditor.h>
|
#include <texteditor/texteditor.h>
|
||||||
@@ -56,14 +57,16 @@ void CppHoverHandler::identifyMatch(TextEditorWidget *editorWidget, int pos, Rep
|
|||||||
tip += evaluator.diagnosis();
|
tip += evaluator.diagnosis();
|
||||||
setPriority(Priority_Diagnostic);
|
setPriority(Priority_Diagnostic);
|
||||||
}
|
}
|
||||||
|
const QStringList fallback = identifierWordsUnderCursor(tc);
|
||||||
if (evaluator.identifiedCppElement()) {
|
if (evaluator.identifiedCppElement()) {
|
||||||
const QSharedPointer<CppElement> &cppElement = evaluator.cppElement();
|
const QSharedPointer<CppElement> &cppElement = evaluator.cppElement();
|
||||||
QStringList candidates = cppElement->helpIdCandidates;
|
const QStringList candidates = cppElement->helpIdCandidates;
|
||||||
candidates.removeDuplicates();
|
const HelpItem helpItem(candidates + fallback, cppElement->helpMark, cppElement->helpCategory);
|
||||||
const HelpItem helpItem(candidates, cppElement->helpMark, cppElement->helpCategory);
|
|
||||||
setLastHelpItemIdentified(helpItem); // tool tip appended by decorateToolTip
|
setLastHelpItemIdentified(helpItem); // tool tip appended by decorateToolTip
|
||||||
if (!helpItem.isValid())
|
if (!helpItem.isValid())
|
||||||
tip += cppElement->tooltip;
|
tip += cppElement->tooltip;
|
||||||
|
} else {
|
||||||
|
setLastHelpItemIdentified({fallback, {}, HelpItem::Unknown});
|
||||||
}
|
}
|
||||||
setToolTip(tip);
|
setToolTip(tip);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user