microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

format do not support AlignEscapedNewlines : LeftWithLastLine

heartacker opened this issue · comments

Environment

名称: C/C++
ID: ms-vscode.cpptools
说明: C/C++ IntelliSense, debugging, and code browsing.
版本: 1.20.5
发布者: Microsoft
VS Marketplace 链接: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools

Bug Summary and Steps to Reproduce

image

Configuration and Logs

"C_Cpp.clang_format_fallbackStyle": "{ BaseOnStyle: LLVM, AlignEscapedNewlines: Left, BreakBeforeBraces: Linux, ColumnLimit: 120, IndentWidth: 4, TabWidth: 4, AllowShortFunctionsOnASingleLine: None, AllowShortBlocksOnASingleLine: Never, AllowShortEnumsOnASingleLine: False,AllowShortLambdasOnASingleLine: None, AlignArrayOfStructures: Left, AlignConsecutiveMacros: AcrossEmptyLines, AlignConsecutiveBitFields: Consecutive }",
格式化失败:
/home/acker/.vscode-server/extensions/ms-vscode.cpptools-1.20.5-linux-x64/bin/../LLVM/bin/clang-format '-style={ BaseOnStyle: LLVM, AlignEscapedNewlines: LeftWithLastLine, BreakBeforeBraces: Linux, ColumnLimit: 120, IndentWidth: 4, TabWidth: 4, AllowShortFunctionsOnASingleLine: None, AllowShortBlocksOnASingleLine: Never, AllowShortEnumsOnASingleLine: False,AllowShortLambdasOnASingleLine: None, AlignArrayOfStructures: Left, AlignConsecutiveMacros: AcrossEmptyLines, AlignConsecutiveBitFields: Consecutive }' -fallback-style=LLVM --Wno-error=unknown -assume-filename=/mnt/e/Users/Acker/OpenGitlab/afe/Untitled-1.c /mnt/e/Users/Acker/OpenGitlab/afe/Untitled-1.c
<command-line>:1:44: error: unknown enumerated scalar
{ BaseOnStyle: LLVM, AlignEscapedNewlines: LeftWithLastLine, BreakBeforeBraces: Linux, ColumnLimit: 120, IndentWidth: 4, TabWidth: 4, AllowShortFunctionsOnASingleLine: None, AllowShortBlocksOnASingleLine: Never, AllowShortEnumsOnASingleLine: False,AllowShortLambdasOnASingleLine: None, AlignArrayOfStructures: Left, AlignConsecutiveMacros: AcrossEmptyLines, AlignConsecutiveBitFields: Consecutive }
                                           ^~~~~~~~~~~~~~~~
Error parsing -style: Invalid argument

Other Extensions

No response

Additional context

No response

@heartacker This is only available with clang-format 19.x which isn't officially released yet (see llvm/llvm-project#93402). We only currently support https://releases.llvm.org/18.1.6/tools/clang/docs/ClangFormatStyleOptions.html .

Your screenshot is from the 19.x docs. The version tag in that doc is only shown for the properties and not the values.