From f03868bd6b1c6d6aeebe12c7c4f6afdf6fae46de Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 11 May 2022 10:54:24 +0200 Subject: [PATCH] ClangCodeModel: Another clangd cursor adjustment QVector should go to QString, not QVector. Fixes: QTCREATORBUG-27524 Change-Id: Iceab3d9a796bbe974a13cea3fa91de9b4aaaee7a Reviewed-by: Reviewed-by: David Schulz --- src/plugins/clangcodemodel/clangdclient.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index 8581c24e631..7125bdbe65d 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -2772,6 +2772,13 @@ QTextCursor ClangdClient::Private::adjustedCursor(const QTextCursor &cursor, c.setPosition(posForToken(destrAst->tilde_token)); return c; } + + // QVector + if (const TemplateIdAST * const templAst = (*it)->asTemplateId()) { + if (posForToken(templAst->greater_token) == cursor.position()) + return leftMovedCursor(); + return cursor; + } } return cursor; }