[all-commits] [llvm/llvm-project] 2a42c7: [clang-format] [PR19056] Add support for access mo...

Budovi via All-commits all-commits at lists.llvm.org
Fri Feb 26 00:17:26 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2a42c759ae7bb09dd448d188138f310d014fcab6
      https://github.com/llvm/llvm-project/commit/2a42c759ae7bb09dd448d188138f310d014fcab6
  Author: Jakub Budiský <jakub.budisky at gmail.com>
  Date:   2021-02-26 (Fri, 26 Feb 2021)

  Changed paths:
    M clang/docs/ClangFormatStyleOptions.rst
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Format/Format.h
    M clang/lib/Format/Format.cpp
    M clang/lib/Format/UnwrappedLineFormatter.cpp
    M clang/lib/Format/UnwrappedLineParser.cpp
    M clang/lib/Format/UnwrappedLineParser.h
    M clang/unittests/Format/FormatTest.cpp

  Log Message:
  -----------
  [clang-format] [PR19056] Add support for access modifiers indentation

Adds support for coding styles that make a separate indentation level for access modifiers, such as Code::Blocks or QtCreator.

The new option, `IndentAccessModifiers`, if enabled, forces the content inside classes, structs and unions (“records”) to be indented twice while removing a level for access modifiers. The value of `AccessModifierOffset` is disregarded in this case, aiming towards an ease of use.

======
The PR (https://bugs.llvm.org/show_bug.cgi?id=19056) had an implementation attempt by @MyDeveloperDay already (https://reviews.llvm.org/D60225) but I've decided to start from scratch. They differ in functionality, chosen approaches, and even the option name. The code tries to re-use the existing functionality to achieve this behavior, limiting possibility of breaking something else.

Reviewed By: MyDeveloperDay, curdeius, HazardyKnusperkeks

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




More information about the All-commits mailing list