[cfe-commits] r82293 - in /cfe/trunk: include/clang/Sema/CodeCompleteConsumer.h lib/Sema/CodeCompleteConsumer.cpp test/CodeCompletion/functions.cpp

Douglas Gregor dgregor at apple.com
Tue Sep 22 18:14:42 PDT 2009


On Sep 22, 2009, at 5:46 PM, Chris Lattner <clattner at apple.com> wrote:

> On Sep 22, 2009, at 3:23 PM, Douglas Gregor wrote:
>>>> I like it. We currently provide qualification when the name in  
>>>> the base class (or an outer context) is *hidden*, because in that  
>>>> case we show the qualification is needed for us to have any  
>>>> chance of doing the right thing.
>>>
>>> Right, I'd expect to see something like this in the 'popup' for P->
>>>
>>> field1
>>> field2         - Base class 'foo'
>>> Base::field2   - Base class 'Base', hidden by 'foo::field2'
>>> field3
>>>
>>> etc, where field1/field3 are direct fields in *p.  This way you  
>>> don't get noise when dealing with simple structs with no base  
>>> classes, etc.
>>
>> I don't particularly like the idea of putting these longish text  
>> strings into the output, and would prefer something shorter and  
>> more subtle:
>>
>> field1
>> <i>foo::</i>field2
>> field3
>> Base::field2
>
>> Two important differences:
>> - the "foo::" for the first field2 is meant to be informative, to  
>> show that we're coming from a base class but without inserting any  
>> text.
>
> Ok, that works for me.  You'll get a bunch of these though for big  
> classes.  To me, it would be nice to have all of the "text to be  
> inserted" lined up at the left and have informational stuff off to  
> the right.  It's probably just a mental shift I need to make though,  
> not a big deal :)

I think what we want is for the member names to be lined up, because  
in the hiding and ambiguity cases the qualifier "Base::" will be part  
of the  "text to be inserted".

>> Right now, fields found in base classes are ranked worse than  
>> fields in the most-derived class, so we actually get something lke
>>
>>    field1
>>    field3
>>    field2
>>    Base::field2
>>
>> which probably isn't what we want.
>
> Doh! :)  Good point,

It's fixed now. Thanks for exposing my silliness :)

   - Doug



More information about the cfe-commits mailing list