Page 1 of 1

cannot get clangd-format on espressif to work

Posted: Mon Jan 13, 2025 7:55 am
by emaayan
hi.. I'm using .clangd-format file in the root file, and I'm mainly trying to format it without breaking lines longer than 80 chars.
not matter what i do , it's still use the default format.
my file is:


# We'll use defaults from the LLVM style, but with some modifications so that it's close to the CDT K&R style.
BasedOnStyle: LLVM
UseTab: Always
IndentWidth: 4
TabWidth: 4
PackConstructorInitializers: NextLineOnly
BreakConstructorInitializers: AfterColon
IndentAccessModifiers: false
AccessModifierOffset: -4
ColumnLimit: 200

Re: cannot get clangd-format on espressif to work

Posted: Mon Jan 13, 2025 8:03 am
by Luxni_
I think it should be called ".clang-format", not ".clangd-format"

Re: cannot get clangd-format on espressif to work

Posted: Mon Jan 13, 2025 10:57 am
by emaayan
it is, sorry my bad, the filename is .clang-format

Re: cannot get clangd-format on espressif to work

Posted: Mon Jan 13, 2025 12:23 pm
by emaayan
Luxni_ wrote:
Mon Jan 13, 2025 8:03 am
I think it should be called ".clang-format", not ".clangd-format"
it was .clang-format (i mystyped) , so that's not the problem.

Re: cannot get clangd-format on espressif to work

Posted: Tue Jan 14, 2025 8:32 am
by Luxni_
I tested it in https://clang-format-configurator.site/ and it worked.
maybe you forgot to add "---" in the first line of the file.

Re: cannot get clangd-format on espressif to work

Posted: Tue Jan 14, 2025 1:33 pm
by emaayan
even after adding the --- it still isn't applied btw, i've never created this file in the first place it's there in all samples.
i'm assuming you don't need to do anything else other RCM source->format source.