[PATCH] D92053: [clangd] Addusing tweak: find insertion point after definition

Adam Czachorowski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 24 12:01:55 PST 2020


adamcz created this revision.
Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman.
Herald added a project: clang.
adamcz requested review of this revision.
Herald added subscribers: MaskRay, ilya-biryukov.

When type/function is defined in the middle of the file, previuosly we
would sometimes insert a "using" line before that definition, leading to
a compilation error. With this fix, we pick a point after such
definition in translation unit.

This is not perfect solution. For example, it still doesn't handle
"using namespace" directives. It is, however, a significant improvement.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92053

Files:
  clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp
  clang-tools-extra/clangd/unittests/TweakTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92053.307427.patch
Type: text/x-patch
Size: 5413 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201124/cfe8b997/attachment.bin>


More information about the cfe-commits mailing list