[clang-tools-extra] [clangd] Let DefineOutline tweak handle member functions (PR #95235)
Julian Schmidt via cfe-commits
cfe-commits at lists.llvm.org
Sat Aug 24 08:54:10 PDT 2024
================
@@ -128,7 +128,27 @@ getFunctionSourceAfterReplacements(const FunctionDecl *FD,
SM.getBufferData(SM.getMainFileID()), Replacements);
if (!QualifiedFunc)
return QualifiedFunc.takeError();
- return QualifiedFunc->substr(FuncBegin, FuncEnd - FuncBegin + 1);
+
+ std::string TemplatePrefix;
+ if (auto *MD = llvm::dyn_cast<CXXMethodDecl>(FD)) {
+ for (const CXXRecordDecl *Parent = MD->getParent(); Parent;
+ Parent =
+ llvm::dyn_cast_or_null<const CXXRecordDecl>(Parent->getParent())) {
+ if (auto Params = Parent->getDescribedTemplateParams()) {
----------------
5chmidti wrote:
Please explicitly write the type here
https://github.com/llvm/llvm-project/pull/95235
More information about the cfe-commits
mailing list