[PATCH] D40486: [clangd] Implemented logging using Context

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 5 09:05:26 PST 2017


ilya-biryukov added a comment.

Additionally:

- All async methods now take `Context` by-value and pass it to their `Callback`s or return them in `future`s.
- All sync methods take `Context` by-ref



In https://reviews.llvm.org/D40486#941210, @sammccall wrote:

> This is pretty bikesheddy, but I wonder what you think about passing Ctx as the first vs last parameter.
>  First has some advantages (maybe I just read too much Go though):
>
> - it's a short expr, and F(short, long) tends to format better than F(long, short). Particularly with lambdas but also long strings.
> - it doesn't interfere with default args
>
>   It would be nice if we could be completely uniform here.


To be fair it was just a random thought and I totally agree with your points. I'll update the implementation and place the `Context` as the first parameter everywhere instead.
Could you take a look at other changes in the patch while I'm at it?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D40486





More information about the cfe-commits mailing list