tom-anders added inline comments.

================
Comment at: clang-tools-extra/clangd/CodeComplete.cpp:2133
   if (const auto *EnumDecl = dyn_cast<clang::EnumDecl>(ND.getDeclContext()))
-    return InTopLevelScope(*EnumDecl) && !EnumDecl->isScoped();
 
----------------
nridge wrote:
> Just to make sure I understand:
> 
> By also removing the `!isScoped()` condition, in addition to changing the 
> behaviour for the scenario described in 
> https://github.com/clangd/clangd/issues/1082 (enum declared at class scope), 
> you are also changing the behaviour for scenarios like this:
> 
> ```
> enum class Foo { Bar };  // at any scope, including global
> ```
> 
> Completing `Bar` will now offer `Foo::Bar` when previously it didn't.
> 
> Is this your intention?
Ah sorry, that is indeed not what I described in the issue - but yeah this 
change is intended here,  IMO it's more consistent from a user perspective: Why 
should **all-scopes**-completion ignore **scoped** enums?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136925

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to