[PATCH] D38538: Avoid printing some redundant name qualifiers in completion

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 9 01:42:27 PDT 2017


ilya-biryukov added inline comments.


================
Comment at: test/CodeCompletion/enum-switch-case-qualified.cpp:25
     // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:23:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
-    // CHECK-CC1: Blue : [#M::N::C::Color#]N::C::Blue
-    // CHECK-CC1-NEXT: Green : [#M::N::C::Color#]N::C::Green
-    // CHECK-CC1-NEXT: Indigo : [#M::N::C::Color#]N::C::Indigo
-    // CHECK-CC1-NEXT: Orange : [#M::N::C::Color#]N::C::Orange
-    // CHECK-CC1-NEXT: Red : [#M::N::C::Color#]N::C::Red
-    // CHECK-CC1-NEXT: Violet : [#M::N::C::Color#]N::C::Violet
-    // CHECK-CC1: Yellow : [#M::N::C::Color#]N::C::Yellow
+    // CHECK-CC1: Blue : [#Color#]N::C::Blue
+    // CHECK-CC1-NEXT: Green : [#Color#]N::C::Green
----------------
arphaman wrote:
> ilya-biryukov wrote:
> > This may be a somewhat unwanted part of this change.
> > Enum type is now written without qualifier here. I would argue that's ok, since the actual enum values are always properly qualified (they have to be, as they are actually inserted by completion) and those qualifiers provide all the necessary context for the user.
> I'm not 100% comfortable with making this kind of change right now. I'll try to investigate what's best for our users.
I changed code to keep qualifiers for enums as is.
(This required moving some code from `libTooling` to `AST` in order to reuse it, I'll create a separate review for that if you're ok with the overall change).


https://reviews.llvm.org/D38538





More information about the cfe-commits mailing list