forked from qt-creator/qt-creator
Clang: Provide highlighting for identifier under cursor
Change-Id: I80ffe23cbcc84ab7323124581d9dd6afbe974fd0 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -118,6 +118,46 @@ bool Cursor::isLocalVariable() const
|
||||
}
|
||||
}
|
||||
|
||||
bool Cursor::isReference() const
|
||||
{
|
||||
return clang_isReference(kind());
|
||||
}
|
||||
|
||||
bool Cursor::isExpression() const
|
||||
{
|
||||
return clang_isExpression(kind());
|
||||
}
|
||||
|
||||
bool Cursor::isFunctionLike() const
|
||||
{
|
||||
const CXCursorKind k = kind();
|
||||
return k == CXCursor_FunctionDecl
|
||||
|| k == CXCursor_CXXMethod
|
||||
|| k == CXCursor_FunctionTemplate;
|
||||
}
|
||||
|
||||
bool Cursor::isConstructorOrDestructor() const
|
||||
{
|
||||
const CXCursorKind k = kind();
|
||||
return k == CXCursor_Constructor
|
||||
|| k == CXCursor_Destructor;
|
||||
}
|
||||
|
||||
bool Cursor::isTemplateLike() const
|
||||
{
|
||||
switch (kind()) {
|
||||
case CXCursor_ClassTemplate:
|
||||
case CXCursor_ClassTemplatePartialSpecialization:
|
||||
return true;
|
||||
case CXCursor_ClassDecl:
|
||||
return specializedCursorTemplate().isValid();
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
Q_UNREACHABLE();
|
||||
}
|
||||
|
||||
bool Cursor::hasFinalFunctionAttribute() const
|
||||
{
|
||||
bool hasFinal = false;
|
||||
@@ -208,6 +248,11 @@ Type Cursor::nonPointerTupe() const
|
||||
return typeResult;
|
||||
}
|
||||
|
||||
Cursor Cursor::specializedCursorTemplate() const
|
||||
{
|
||||
return clang_getSpecializedCursorTemplate(cxCursor);
|
||||
}
|
||||
|
||||
SourceLocation Cursor::sourceLocation() const
|
||||
{
|
||||
return clang_getCursorLocation(cxCursor);
|
||||
|
||||
Reference in New Issue
Block a user