aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2022-01-26 12:40:12 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2022-01-28 12:34:48 +0000
commitabe09bfd763b4e37aa8d76884412a755ef7be5dd (patch)
tree712d7e7d66c1c3d01ccce40818ef62bba45f7d7b /src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
parentdd527a389027e65881909ab75f2fd3f662b8b71a (diff)
ClangCodeModel: Adjust cursor for following destructor symbols
... with clangd. More specifically, for the case where we switch between declaration and definition of a destructor. Since clangd expects the cursor before the "~" character, we move it there. Fixes: QTCREATORBUG-26809 Change-Id: I8ea6a060bea3545c963cb8ebbe2d3ae3a18da2d5 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp')
-rw-r--r--src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
index 8cfff10c65..81b410a3cd 100644
--- a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
+++ b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
@@ -263,10 +263,6 @@ F2TestCase::F2TestCase(CppEditorAction action,
QSKIP("fuzzy matching is not supposed to work with clangd"); // TODO: Implement fallback as we do with libclang
if (tag == "baseClassFunctionIntroducedByUsingDeclaration")
QSKIP("clangd points to the using declaration");
- if (tag == "classDestructor" || tag == "fromDestructorDefinitionSymbol"
- || tag == "fromDestructorBody") {
- QSKIP("clangd wants the cursor before the ~ character");
- }
if (curTestName == "testFollowClassOperatorInOp")
QSKIP("clangd goes to operator name first");
}
@@ -438,6 +434,10 @@ F2TestCase::F2TestCase(CppEditorAction action,
} else {
currentTextEditor->convertPosition(targetTestFile->m_targetCursorPosition,
&expectedLine, &expectedColumn);
+ if (useClangd && (tag == "classDestructor" || tag == "fromDestructorDefinitionSymbol"
+ || tag == "fromDestructorBody")) {
+ --expectedColumn; // clangd goes before the ~, built-in code model after
+ }
}
// qDebug() << "Expected line:" << expectedLine;
// qDebug() << "Expected column:" << expectedColumn;