Unsupported clang-format options

Sysprogs forums Forums VisualGDB Unsupported clang-format options

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #29707
    Ophidian14
    Participant

    Hello,

    My company, always on the bleeding edge, decided to merge this into our repo’s clang format file:

    BraceWrapping:
    - AfterCaseLabel: true

    As I understand it, this option is new to Clang10.  VisualGDB seems to choke on it, and formats my file using some other, unknown format where everything is wrapped at 80 columns, braces are always on the same line, etc.  Is there any way that unknown options can just be ignored?

    #29708
    support
    Keymaster

    Hi,

    Our clang-format-based formatter is indeed based on an older version of Clang (6.0). All options supported by this version should work out-of-the-box. We will update it to use a newer Clang version in the next major VisualGDB release, so the newly added options will work as well.

    #29709
    Ophidian14
    Participant

    Okay, but is there any way I can get it to ignore unknown options?  Instead of re-formatting in a completely wrong way?

    #29711
    support
    Keymaster

    The loading and applying of formatting styles is done by the clang-format directly and is outside of VisualGDB control. The best thing we can offer is to add a setting to filter out lines containing specific substrings in the clang-format file (e.g. you can blacklist AfterCaseLabel) and VisualGDB will automatically remove that entire line from the .clang-format file before passing it to the clang engine.

    #29713
    Ophidian14
    Participant

    That honestly would be a lifesaver.

    #29715
    support
    Keymaster

    No problem, please try this build: VisualGDB-5.5.104.3933.msi

    You can set the new Tools->Options->Text Editor->C/C++(VisualGDB)->Formatting Engine->Ignored clang-format statements option to AfterCaseLabel and VisualGDB will automatically filter out any lines containing AfterCaseLabel (the check is case-sensitive) when loading clang-format files. You can separate multiple values via semicolons.

    #29716
    Ophidian14
    Participant

    Yes!!  It works.  Thank you.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.