[all-commits] [llvm/llvm-project] 910871: [clangd] Fix AddUsing tweak for out-of-line functi...

Adam Czachorowski via All-commits all-commits at lists.llvm.org
Thu May 7 03:51:09 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 91087153210132a4c2d3cf19a4526d8f395cb5a4
      https://github.com/llvm/llvm-project/commit/91087153210132a4c2d3cf19a4526d8f395cb5a4
  Author: Adam Czachorowski <adamcz at google.com>
  Date:   2020-05-07 (Thu, 07 May 2020)

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

  Log Message:
  -----------
  [clangd] Fix AddUsing tweak for out-of-line functions.

Summary:
We used getEnclosingNamespaceContext(), which calls getParent() rather
than getLexicalParent(), so we would end up adding the "using" line in
places that do not affect the cursor location, or just return an error
when declaration was in another file.

Patch by Adam Czachorowski!

Reviewers: hokein

Reviewed By: hokein

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

Tags: #clang

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




More information about the All-commits mailing list