[cfe-dev] Quirky diagnostic/fixit when using insertions

Chandler Carruth chandlerc at google.com
Mon Aug 22 10:32:35 PDT 2011


FYI, I'll try to comment later on some of the details of these syntaxes, but
this is something I've wanted to look into as well.

Currently I'm working on refactorings to the text diagnostic printer that
should make experimenting with these alternate syntaxes much much more
reasonable.

On Mon, Aug 22, 2011 at 10:16 AM, David Blaikie <dblaikie at gmail.com> wrote:

> Thanks - that's (2) at least. Following on from the bug discussion I think
> it'd be a pity to drop the fixit entirely - though better than having it
> broken like that, sure.
>
> Could we toss around some alternative syntax options & see what people
> think?
>
> A var = { b};
>           ^
>           s)atic_cast<unsigned int>(
>
> One option would be to just suggest the whole replacement (not by changing the FixIt emitted - that should remain the same so it's fully descriptive for other tools. But just to change the way its rendered):
>
> A var = { b};
>           ^
>           static_cast<unsigned int>(b)
>
> or somehow attach the start & end separately:
>
> A var = { b};
>           ^^-------------------------\
>           static_cast<unsigned int>( )
>
> Though that doesn't really scale up to more than one overlap. (which might be sufficient to cover more/most cases like this)
>
> A simple separated list (could benefit from color highlighting, but we wouldn't want to depend on that)
>
> A var = { b};
>           ^^
>           static_cast<unsigned int>( )
>
> Is there any good separator we could use in this list that wouldn't get confused with the actual replacement text?
>
> (could we even render fixits completely differently in the presence of terminal colors?
>
> A var = { *static_cast<unsigned int>(*b*)*};
>
> Though I suppose this doesn't account for replacements (where we'd want to show the old & the new text) in which case we could pad the original text:
>
> A var = { foo   (b)};
>           foobar
>
> )
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110822/64d25cd7/attachment.html>


More information about the cfe-dev mailing list