<div style="font-family: arial, helvetica, sans-serif; font-size: 10pt">+richardsmith<div><br></div><div>I just chatted with Richard, and he suggested adding it to ASTContext would be a good fit.</div><div><br></div><div>Cheers,</div>
<div>/Manuel</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 14, 2012 at 9:23 AM, Jordan Rose <span dir="ltr"><<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
On Nov 14, 2012, at 8:39 , David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
<br>
> On Wed, Nov 14, 2012 at 6:01 AM, Daniel Cheng <<a href="mailto:dcheng@google.com">dcheng@google.com</a>> wrote:<br>
>> I recently wrote a small tool to do some automated refactoring. During<br>
>> that work, I ended up writing some helper functions to "simplify"<br>
>> fully qualified names, i.e. if you're already in namespace a::b, you<br>
>> can refer to a::b::C as "C" rather than using the fully qualified<br>
>> name. I'm wondering if there'd be interest in upstreaming this<br>
>> functionality into Clang, as I believe this would be a generally<br>
>> useful utility.<br>
>><br>
>> Currently, I have the following signature:<br>
>><br>
>> // Attempts to find the most concise way to refer to 'symbol' in the given<br>
>> // context. 'symbol' should be a fully qualified name.<br>
>> string SimplifySymbol(<br>
>>    const clang::ASTContext& ast_context,<br>
>>    const clang::DeclContext* context,<br>
>>    const string& symbol);  // I think this should probably be a<br>
>> NamedDecl* to prevent ambiguities<br>
>><br>
>> Do other people feel this sort of thing would be helpful, and if so,<br>
>> where would it belong? It seems like it ought to be a member of<br>
>> NamedDecl or DeclContext, but I'm new to Clang development, so I'm<br>
>> interested in feedback and comments. Thanks!<br>
><br>
> I haven't looked closely but would this be applicable to Clang's typo<br>
> correction logic & improve the quality of the typo correction by<br>
> offering minimally qualified names?<br>
><br>
> If that's the case that might be a good angle of attack to get this<br>
> upstream with a solid use case.<br>
<br>
</div></div>I also haven't looked closely, but another good use case is code completion, where I'd rather have "IfStmt" than "clang::IfStmt". (I think we get this one right already, but there are other examples that we don't.)<br>

<span class="HOEnZb"><font color="#888888"><br>
Jordan<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div></div>