[PATCH] Add clang-format VS extension

Manuel Klimek klimek at google.com
Fri Aug 30 09:32:54 PDT 2013


On Fri, Aug 30, 2013 at 6:08 PM, Nico Rieck <nico.rieck at gmail.com> wrote:

>
>   Another thing I forgot to ask. Since more C# code might be introduced in
> the future, do we really want to settle on the vertically verbose Allman
> style for braces?
>

I personally couldn't care less ;) I used what VS does by default. I'm
happy to use LLVM C++ style, as I then can use clang-format...

================
> Comment at: tools/clang-format-vs/ClangFormat/ClangFormatPackage.cs:139
> @@ +138,3 @@
> +            {
> +                throw new Exception(process.StandardError.ReadToEnd());
> +            }
> ----------------
> Manuel Klimek wrote:
> > Nico Rieck wrote:
> > > IIRC redirecting the standard streams and reading this way can become
> problematic if the internal buffer becomes full. It might be better to use
> the {Output,Error}DataReceived events to collect the output asynchronously
> into a StringBuffer.
> > I carefully crafted the order to make sure this cannot happen. I now
> added comments that explain why I think this is safe (it requires some
> knowledge about how clang-format works; I think the probability that this
> will change in the future is very low and I also think it simplifies the
> code here enough that it's worth it).
> This works fine for stdout, but stderr is read after WaitForExit which
> will deadlock if the stderr buffer (4096 bytes) is filled. So as long as
> clang-format never writes this much to stderr this will work. (Though the
> alternative of reading stderr asynchronously and waiting on a resetevent
> after process exit isn't that much more difficult.)
>

Ah, right, I completely ignored stderr - I don't expect this to matter
much, so are you OK with a FIXME and addressing this in a later patch?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130830/640f1ec8/attachment.html>


More information about the cfe-commits mailing list