C++ editor: Try to find a help item if there is a syntax error

Task-number: QTCREATORBUG-2674
This commit is contained in:
Leandro Melo
2011-01-17 16:29:57 +01:00
parent 51c4740266
commit bcaf20319d
6 changed files with 87 additions and 62 deletions

View File

@@ -70,11 +70,15 @@ public:
void setTextCursor(const QTextCursor &tc);
void setLookupBaseClasses(const bool lookup);
QSharedPointer<CppElement> identifyCppElement();
void execute();
bool identifiedCppElement() const;
const QSharedPointer<CppElement> &cppElement() const;
bool hasDiagnosis() const;
const QString &diagnosis() const;
private:
void evaluate();
bool matchDiagnosticMessage(const CPlusPlus::Document::Ptr &document, unsigned line);
void clear();
void checkDiagnosticMessage(const CPlusPlus::Document::Ptr &document, unsigned line);
bool matchIncludeFile(const CPlusPlus::Document::Ptr &document, unsigned line);
bool matchMacroInUse(const CPlusPlus::Document::Ptr &document, unsigned pos);
void handleLookupItemMatch(const CPlusPlus::Snapshot &snapshot,
@@ -86,6 +90,7 @@ private:
QTextCursor m_tc;
bool m_lookupBaseClasses;
QSharedPointer<CppElement> m_element;
QString m_diagnosis;
};
class CppElement
@@ -129,18 +134,6 @@ private:
QString m_type;
};
class CppDiagnosis : public CppElement
{
public:
CppDiagnosis(const CPlusPlus::Document::DiagnosticMessage &message);
virtual ~CppDiagnosis();
const QString &text() const;
private:
QString m_text;
};
class CppInclude : public CppElement
{
public: