[all-commits] [llvm/llvm-project] 7a54fc: [clang-format] Handle C# 9 `init` accessor specifier.

Marek Kurdej via All-commits all-commits at lists.llvm.org
Tue Mar 8 04:33:54 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7a54fceb256257e3f8c8bd16ffd55531d806c96e
      https://github.com/llvm/llvm-project/commit/7a54fceb256257e3f8c8bd16ffd55531d806c96e
  Author: Marek Kurdej <marek.kurdej+llvm.org at gmail.com>
  Date:   2022-03-08 (Tue, 08 Mar 2022)

  Changed paths:
    M clang/lib/Format/FormatToken.h
    M clang/lib/Format/TokenAnnotator.cpp
    M clang/lib/Format/UnwrappedLineParser.cpp
    M clang/unittests/Format/FormatTestCSharp.cpp

  Log Message:
  -----------
  [clang-format] Handle C# 9 `init` accessor specifier.

Before, the code:
```
int Value { get; } = 0;
int Value { init; } = 0;
```
was formatted incoherently:
```
int Value { get; } = 0;
int Value { init; }
= 0;
```
because `init` was not recognised as an accessor specifier.

Reviewed By: MyDeveloperDay, HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D121132




More information about the All-commits mailing list