vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

format code issue: break in macro,

Open heartacker opened this issue 9 months ago • 5 comments

AlignArrayOfStructures: Left

ORIGIN:

const struct reg aa[] __CMN_RODATA = {
    { abc,    0, format, code },
    { abcd2,  0, format, code },
    { aaaa,   0, why,    why  },
    { whyyyy, 0, why,    why  },
};

add macro:


const struct reg aa[] __CMN_RODATA = {
#if A
    { abc,   0, format, code },
    { abcd2, 0, format, code },
#else
    { aaaa, 0, why, why },
    { whyyyy, 0, why, why },
#endif
};

if 0:

heartacker avatar Jul 12 '25 06:07 heartacker

please help mebrother

heartacker avatar Jul 12 '25 13:07 heartacker

@heartacker This is a bug with clang-format -- I repro it with the command line (as can be seen in the debug logging, but you need to add the filename since the displayed logging operates on stdin), e.g. /Users/user/.vscode/extensions/ms-vscode.cpptools-1.26.3-darwin-arm64/bin/../LLVM/bin/clang-format --style=file --fallback-style=LLVM --Wno-error=unknown /Users/user/Documents/Tests/test/test.cpp > /Users/user/Documents/Tests/test/test.out.cpp Can you file a bug at https://github.com/llvm/llvm-project/issues ?

sean-mcmanus avatar Jul 14 '25 15:07 sean-mcmanus

please help me, it works before ,dear sean

heartacker avatar Jul 16 '25 02:07 heartacker

@sean-mcmanus maybe you should revert the clfmt version。 it works before

heartacker avatar Jul 16 '25 03:07 heartacker

@heartacker Which version of the C/C++ extension and/or clang-format did it work with?

sean-mcmanus avatar Jul 16 '25 19:07 sean-mcmanus