From 9426ce99a1f33447e07ce6d2e1860bee753fb018 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 28 May 2021 14:30:49 +0200 Subject: [PATCH] ClangCodeModel: Fix providing virtual override list ... when the cursor is right before the opening parenthesis of a member function call. The clang AST is different then. Change-Id: Ibb75c15d2e28c2004b5ab2dd8fd3db0a2da88e56 Reviewed-by: David Schulz --- src/plugins/clangcodemodel/clangdclient.cpp | 3 ++- .../cppeditor/followsymbol_switchmethoddecldef_test.cpp | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index 2eea1c1f46d..8db7c7a341d 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -138,7 +138,8 @@ public: bool isMemberFunctionCall() const { - return role() == "expression" && kind() == "Member" && arcanaContains("member function"); + return role() == "expression" && (kind() == "CXXMemberCall" + || (kind() == "Member" && arcanaContains("member function"))); } bool isPureVirtualDeclaration() const diff --git a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp index fbd23e1bd0b..7b7803d98f8 100644 --- a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp +++ b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp @@ -446,12 +446,6 @@ F2TestCase::F2TestCase(CppEditorAction action, }); t.start(10000); l.exec(); - QEXPECT_FAIL("possibleOverrides2", - "FIXME: clangd behaves differently with cursor at end of function name", - Abort); - QEXPECT_FAIL("QTCREATORBUG-10294_cursorIsAtTheEndOfVirtualFunctionName", - "FIXME: clangd behaves differently with cursor at end of function name", - Abort); QEXPECT_FAIL("noSiblings_references", "FIXME: check why this fails", Abort); QEXPECT_FAIL("noSiblings_pointers", "FIXME: check why this fails", Abort); QEXPECT_FAIL("noSiblings_noBaseExpression", "FIXME: check why this fails", Abort);