[cfe-dev] clang-format comments issue

Manuel Klimek klimek at google.com
Wed Jan 22 23:21:11 PST 2014


+cfe-dev, djasper, alexfh

On Thu, Jan 23, 2014 at 6:36 AM, Nikola Smiljanic <popizdeh at gmail.com>wrote:

> Hi Manuel, my quick and dirty fixes with little understanding of the code
> failed miserably. So before I invest any more time I'd like to see what you
> think. Two or more lines that have nothing more than comments are not
> squished together as in:
>
> // This is a very long comment that goes over the column limit but also
> continues
> // on the next line and is not properly formatted.
>
> is formatted as:
>
> // This is a very long comment that goes over the column limit but also
> // continues
> // on the next line and is not properly formatted.
>
> My quick look at the code gave me an idea that both of these tokens should
> become one UnwrappedLine. Does this make any sense? Is there a way to
> combine the text of two comment tokens into one token? This would probably
> only make sense in the case where line has nothing but the comments and I'm
> not sure if that information is available...
>

Yes that's basically the idea. I think at some point Alex has looked into
this, but I don't know what the state was - it's definitely not a trivial
matter, as having a single UnwrappedLine is not enough - we'd basically
want to create single "Token"s for comments that we want to reflow.

Cheers,
/Manuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140123/d3641f99/attachment.html>


More information about the cfe-dev mailing list