aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/clangcodemodel/clangdclient.cpp7
-rw-r--r--src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp8
2 files changed, 11 insertions, 4 deletions
diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp
index 7ce3cc243ff..78d3793b502 100644
--- a/src/plugins/clangcodemodel/clangdclient.cpp
+++ b/src/plugins/clangcodemodel/clangdclient.cpp
@@ -2458,6 +2458,13 @@ QTextCursor ClangdClient::Private::adjustedCursor(const QTextCursor &cursor,
}
return cursor;
}
+
+ // ~My|Class
+ if (const DestructorNameAST * const destrAst = (*it)->asDestructorName()) {
+ QTextCursor c = cursor;
+ c.setPosition(posForToken(destrAst->tilde_token));
+ return c;
+ }
}
return cursor;
}
diff --git a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
index 8cfff10c658..81b410a3cda 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;