[all-commits] [llvm/llvm-project] a20050: [clangd] Addusing tweak: find insertion point afte...

Adam Czachorowski via All-commits all-commits at lists.llvm.org
Tue Nov 24 14:02:28 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a200501bca4dc7f3292d824f249fa21a479e9873
      https://github.com/llvm/llvm-project/commit/a200501bca4dc7f3292d824f249fa21a479e9873
  Author: Adam Czachorowski <adamcz at google.com>
  Date:   2020-11-24 (Tue, 24 Nov 2020)

  Changed paths:
    M clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp
    M clang-tools-extra/clangd/unittests/TweakTests.cpp

  Log Message:
  -----------
  [clangd] Addusing tweak: find insertion point after definition

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 a perfect solution. For example, it still doesn't handle
"using namespace" directives. It is, however, a significant improvement.

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




More information about the All-commits mailing list