[PATCH] D122698: [clangd] Add support to extract method for ExtractFunction Tweak

Fabio R. Sluzala via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 29 18:06:15 PDT 2022


FabioRS created this revision.
FabioRS added a reviewer: sammccall.
FabioRS added a project: clang-tools-extra.
Herald added subscribers: usaxena95, kadircet, arphaman.
Herald added a project: All.
FabioRS requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.

I miss more automatically refactoring functions when working with already running code, so I am making some small addition that I hope help more people.

This works by checking if the function is a method (CXXMethodDecl), then collecting information about the function that the code is being extracted, looking for the declaration if it is out-of-line, creating the declaration if it is necessary and putting the extracted function as a class-method.

This is my first code review request, sorry if I did something wrong.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122698

Files:
  clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp
  clang-tools-extra/clangd/unittests/tweaks/ExtractFunctionTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122698.419022.patch
Type: text/x-patch
Size: 11851 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220330/1bdf224b/attachment.bin>


More information about the cfe-commits mailing list