[Clangd] ExtractFunction: Don't extract body of enclosing function.
authorShaurya Gupta <shauryab98@gmail.com>
Wed, 2 Oct 2019 13:52:14 +0000 (13:52 +0000)
committerShaurya Gupta <shauryab98@gmail.com>
Wed, 2 Oct 2019 13:52:14 +0000 (13:52 +0000)
commita24762e773d90c9e195d763297ef04af42ff2e34
tree81a53f4eced94fdac563077b105c881d2a6cc1b7
parentf1758079540c17166f0ac439af1e8f609cd94735
[Clangd] ExtractFunction: Don't extract body of enclosing function.

Summary:
This patch disable extraction of the body of the enclosing function.
`void f() [[{}]]`

Extracting this CompoundStmt would leave the enclosing function without
a body.

Reviewers: sammccall, kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68245

llvm-svn: 373472
clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp
clang-tools-extra/clangd/unittests/TweakTests.cpp