[PATCH] D87775: [clangd] Add option for disabling AddUsing tweak on some namespaces.
Adam Czachorowski via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 17 08:44:31 PDT 2020
adamcz added inline comments.
================
Comment at: clang-tools-extra/clangd/ConfigFragment.h:167
+ struct StyleBlock {
+ // List of namespaces that should not appear in "using" declarations.
+ std::vector<Located<std::string>> FullyQualifiedNamespaces;
----------------
sammccall wrote:
> Can we describe this positively first?
>
> Namespaces whose members should be fully-qualified, rather than via using declarations or directives.
> Affects availability of the "add using declaration" tweak.
I copied the comment from the other place and added the bit about tweak. WDYT?
================
Comment at: clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp:197
+ std::string Buf;
+ llvm::raw_string_ostream NamespaceStream(Buf);
+ Namespace.print(NamespaceStream,
----------------
sammccall wrote:
> validate it's a namespace, and then call printNamespaceScope (AST.h)?
>
> This handles the right spelling of anonymous/inline NSes.
It's already guaranteed to be a namespace, that's checked before calling this function.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87775/new/
https://reviews.llvm.org/D87775
More information about the cfe-commits
mailing list