[PATCH] D140915: [clangd] Fix getQueryScopes for using-directive with inline namespace

Tom Praschan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 1 14:30:13 PST 2023


tom-anders added inline comments.


================
Comment at: clang-tools-extra/clangd/CodeComplete.cpp:1709
+
+    // The enclosing namespace must be first, it gets a quality boost.
+    if (auto Enclosing = SpecifiedScopes.EnclosingNamespace) {
----------------
kadircet wrote:
> i was actually suggesting to put this logic inside `SpecifiedScope::scopesForIndexQuery` any reason for only including it in this code path?
Ah I just misunderstood, moved the logic to `scopesForIndexQuery` now.


================
Comment at: clang-tools-extra/clangd/CodeComplete.cpp:1719
+                  });
+    llvm::copy_if(SpecifiedScopes.scopesForQualification(),
+                  std::back_inserter(AccessibleScopes),
----------------
kadircet wrote:
> `AccessibleScopes` doesn't need any particular ordering. we can use `scopesForQualification` as-is.
Might as well just make it a std::set instead of std::vector? 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140915/new/

https://reviews.llvm.org/D140915



More information about the cfe-commits mailing list