[all-commits] [llvm/llvm-project] 97d6e8: [clangd] Helper for getting nested namespace quali...

kadir çetinkaya via All-commits all-commits at lists.llvm.org
Mon Nov 25 01:42:21 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 97d6e8e0f3748e6fe2b27983803e2df75874507e
      https://github.com/llvm/llvm-project/commit/97d6e8e0f3748e6fe2b27983803e2df75874507e
  Author: Kadir Cetinkaya <kadircet at google.com>
  Date:   2019-11-25 (Mon, 25 Nov 2019)

  Changed paths:
    M clang-tools-extra/clangd/AST.cpp
    M clang-tools-extra/clangd/AST.h
    M clang-tools-extra/clangd/unittests/ASTTests.cpp

  Log Message:
  -----------
  [clangd] Helper for getting nested namespace qualification

Summary:
Introduce a new helper for getting minimally required qualifiers
necessary to spell a name at a point in a given DeclContext. Currently takes
using directives and nested namespecifier of DeclContext itself into account.

Initially will be used in define inline and outline actions.

Reviewers: ilya-biryukov

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

Tags: #clang

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


  Commit: 5075c68219826a199c67f7450c7cf60a55a71c0b
      https://github.com/llvm/llvm-project/commit/5075c68219826a199c67f7450c7cf60a55a71c0b
  Author: Kadir Cetinkaya <kadircet at google.com>
  Date:   2019-11-25 (Mon, 25 Nov 2019)

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

  Log Message:
  -----------
  [clangd] Improve symbol qualification in DefineInline code action

Summary:
Currently define inline action fully qualifies any names in the
function body, which is not optimal and definitely natural.

This patch tries to improve the situation by dropping any name
specifiers shared by function and names spelled in the body. For example
if you are moving definition of a function in namespace clang::clangd,
and body has any decl's coming from clang or clang::clangd namespace,
those qualifications won't be added since they are redundant.

It also drops any qualifiers that are visible in target context.

Reviewers: ilya-biryukov

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

Tags: #clang

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


Compare: https://github.com/llvm/llvm-project/compare/aa16bf15fe38...5075c6821982


More information about the All-commits mailing list