[PATCH] D92257: [clang-format] Add option to control the space at the front of a line comment

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 18 11:20:30 PST 2022

HazardyKnusperkeks added a comment.

In D92257#3249650 <https://reviews.llvm.org/D92257#3249650>, @ksyx wrote:

> In D92257#3004563 <https://reviews.llvm.org/D92257#3004563>, @HazardyKnusperkeks wrote:
>> In D92257#3003281 <https://reviews.llvm.org/D92257#3003281>, @byronhe wrote:
>>> Hi guys,i found `SpacesInLineCommentPrefix` does not support other encoding such as utf8 ,
>>> I am curious why there is a `isAlphanumeric` limit in `BreakableLineCommentSection::BreakableLineCommentSection()` ?
>>> I want to make some contribution to make it support utf8, what should i do ?
>> The `isAlphanumeric` is there to not break doxygen like comments for example.
>> I'm very interested in how you want to tackle that problem. :)
> Sorry for digging out this months long thing but I encountered this in one project full of non-alphanumeric comment. If I understood the problem correctly, is it more like avoiding symbols like @ / * rather than avoiding non-ASCII characters like CJK's? In this case, would just not changing leading spaces when it is started with symbols make this option usable for wider amount of comment content? :)

So we basically have to choose between using this simple trick, but excluding non latin characters, or creating a list where we do not add spaces, which is possibly incomplete.

But please create a patch and we will evaluate it.

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list