Adding D support to Clang format

Johan j at j.nl
Sat Apr 29 10:08:41 UTC 2023


On Friday, 28 April 2023 at 23:30:37 UTC, Zachary Yedidia wrote:
> Clang format is a high quality auto-formatter developed by the 
> LLVM project, mainly for use with C and C++, but it also 
> supports Java, C#, JavaScript, JSON, Objective-C, Proto, 
> TableGen, TextProto, and Verilog. I think it would be great to 
> add support for D, and hopefully shouldn't be too difficult 
> since it is a C-like language.

clang-format is indeed a godsent formatter.
I recently also read that it can do languages quite different 
from C, and hoped for D support in the future.
It will be very nice for people (like me) who work on mixed C++/D 
codebases.

> I have started an implementation for D here: 
> https://github.com/zyedidia/llvm-project/tree/clang-format-d, 
> with some information about the implementation here (how to 
> download/build/test): 
> https://github.com/zyedidia/llvm-project/blob/clang-format-d/clang-format-d.md.

Great you are picking this up and leading the effort!
Hope to be able to help out.

Tip: already start discussing on the LLVM maillist of how to 
upstream the work, to avoid have to rework certain pieces later. 
Obviously adhere to the LLVM writing style (which you already 
do), but there may be some other concerns that are less obvious.

cheers,
   Johan



More information about the Digitalmars-d mailing list