forked from qt-creator/qt-creator
ClangCodeModel: Fix highlighting problem with template types
With clangd, we mis-detected variables of template types as output parameters in certain contexts. Change-Id: I906abd489f987351793f4ef676e4af59cdfdbf97 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -252,6 +252,16 @@ public:
|
||||
QString theType = type();
|
||||
if (theType.endsWith("const"))
|
||||
theType.chop(5);
|
||||
|
||||
// We don't care about the "inner" type of templates.
|
||||
const int openAngleBracketPos = theType.indexOf('<');
|
||||
if (openAngleBracketPos != -1) {
|
||||
const int closingAngleBracketPos = theType.lastIndexOf('>');
|
||||
if (closingAngleBracketPos > openAngleBracketPos) {
|
||||
theType = theType.left(openAngleBracketPos)
|
||||
+ theType.mid(closingAngleBracketPos + 1);
|
||||
}
|
||||
}
|
||||
const int xrefCount = theType.count("&&");
|
||||
const int refCount = theType.count('&') - 2 * xrefCount;
|
||||
const int ptrRefCount = theType.count('*') + refCount;
|
||||
|
||||
Reference in New Issue
Block a user