forked from qt-creator/qt-creator
Try to get the type from a qualified-id.
This commit is contained in:
@@ -142,11 +142,13 @@ void QmlHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
|
||||
return;
|
||||
|
||||
const SemanticInfo semanticInfo = edit->semanticInfo();
|
||||
const Snapshot snapshot = semanticInfo.snapshot;
|
||||
Document::Ptr qmlDocument = semanticInfo.document;
|
||||
if (qmlDocument.isNull())
|
||||
|
||||
if (semanticInfo.revision() != edit->documentRevision())
|
||||
return;
|
||||
|
||||
const Snapshot snapshot = semanticInfo.snapshot;
|
||||
const Document::Ptr qmlDocument = semanticInfo.document;
|
||||
|
||||
if (m_helpEngineNeedsSetup && m_helpEngine->registeredDocumentations().count() > 0) {
|
||||
m_helpEngine->setupData();
|
||||
m_helpEngineNeedsSetup = false;
|
||||
@@ -169,10 +171,10 @@ void QmlHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
|
||||
AST::UiObjectMember *declaringMember = semanticInfo.declaringMember(pos);
|
||||
|
||||
Interpreter::Engine interp;
|
||||
Interpreter::ObjectValue *scope = Bind::scopeChainAt(qmlDocument, snapshot, &interp, declaringMember);
|
||||
const Interpreter::ObjectValue *scope = Bind::scopeChainAt(qmlDocument, snapshot, &interp, declaringMember);
|
||||
|
||||
Check check(&interp);
|
||||
const Interpreter::Value *value = check(node->expressionCast(), scope);
|
||||
const Interpreter::Value *value = check(node, scope);
|
||||
|
||||
QStringList baseClasses;
|
||||
m_toolTip = prettyPrint(value, &interp, &baseClasses);
|
||||
|
||||
@@ -567,6 +567,16 @@ QmlJSTextEditor::~QmlJSTextEditor()
|
||||
{
|
||||
}
|
||||
|
||||
SemanticInfo QmlJSTextEditor::semanticInfo() const
|
||||
{
|
||||
return m_semanticInfo;
|
||||
}
|
||||
|
||||
int QmlJSTextEditor::documentRevision() const
|
||||
{
|
||||
return document()->revision();
|
||||
}
|
||||
|
||||
Core::IEditor *QmlJSEditorEditable::duplicate(QWidget *parent)
|
||||
{
|
||||
QmlJSTextEditor *newEditor = new QmlJSTextEditor(parent);
|
||||
|
||||
@@ -131,7 +131,8 @@ public:
|
||||
|
||||
virtual void unCommentSelection();
|
||||
|
||||
SemanticInfo semanticInfo() const { return m_semanticInfo; }
|
||||
SemanticInfo semanticInfo() const;
|
||||
int documentRevision() const;
|
||||
|
||||
public slots:
|
||||
virtual void setFontSettings(const TextEditor::FontSettings &);
|
||||
|
||||
Reference in New Issue
Block a user