Page 1 of 1

Espressif-IDE v3.0.0 (stable) --- Can not get Code format to work

Posted: Fri Jun 07, 2024 10:17 am
by DesignerRick
I can see lots of improvements in the Eclipse IDE V3.0.0 however I can not change the C Code Formatter off default.

I use a custom format (like GNU) but even though I select it the Source -> Format always seem to use K&R Built in.

I can not even select other built in formatters or use "Project specific" format.

What do I need to do to change the code formatter?

Thank you

Re: Espressif-IDE v3.0.0 (stable) --- Can not get Code format to work

Posted: Sat Jun 08, 2024 5:01 pm
by elettronica67
Hi,
I have the same problem, seems that also key binding preferences are completely overlapped by the Espressif plugin.
Is there a way to set my own key mapping?
Thank you

Re: Espressif-IDE v3.0.0 (stable) --- Can not get Code format to work

Posted: Fri Jun 14, 2024 8:04 am
by ESP_aliazamrana
DesignerRick wrote:
Fri Jun 07, 2024 10:17 am
I can see lots of improvements in the Eclipse IDE V3.0.0 however I can not change the C Code Formatter off default.

I use a custom format (like GNU) but even though I select it the Source -> Format always seem to use K&R Built in.

I can not even select other built in formatters or use "Project specific" format.

What do I need to do to change the code formatter?

Thank you
Please note that the new cdt-lsp editor used with the plugin is using clangd so the formatting from the eclipse preferences may work for the default editor but not with the new editor. See the following links
https://github.com/eclipse-cdt/cdt-lsp# ... ang-format
https://clang.llvm.org/docs/ClangFormat ... tions.html

You may have to rewrite your xml formatter to .clang-format file

Re: Espressif-IDE v3.0.0 (stable) --- Can not get Code format to work

Posted: Sat Jun 22, 2024 1:11 pm
by elettronica67
Hi, thank you for your answer, unfortunately I don't find any .clang-format file in the project created using last 3.00 ESP-IDF plugin, then, after installing in Eclipse and created a new project (e.g. starting from existing template "blink"), if I go on Windows -> Preferences -> Editor LSP -> clangd, I got a window with this error:

"The currently displayed page contains invalid values"

The error appears also when I open another project (No Esressif project)
If I re-install Eclipse without plugin I don't get this error, I have error only after installing plugin.

So my question is: Is there a way to install ESP-IDF 3.00 and work without "clangd" features?

Thank you
Paolo

Re: Espressif-IDE v3.0.0 (stable) --- Can not get Code format to work

Posted: Sun Jun 23, 2024 3:08 pm
by ESP_kondalkolipaka
Hello,

You can create a .clang-format file at the root of the project and define the format style accordingly. We will take this up in the next release, we can create it by default.

Below references might help
https://github.com/eclipse-cdt/cdt-lsp? ... ang-format
https://clang.llvm.org/docs/ClangFormat ... tions.html

We are not supporting working without clangd features in the Espressif-IDE 3.0.0. However, you an always use v2.12.1(Our previous release) if you want to continue working with standard C/C++ editor.

Issue related to preferences, please share the error log with us so that we can take a look and provide a patch release if required.

Thanks.

Re: Espressif-IDE v3.0.0 (stable) --- Can not get Code format to work

Posted: Sun Jun 23, 2024 4:07 pm
by ESP_kondalkolipaka
Hi All,

Here is the way to generate default .clang-format file based on the configurable format style options

For example in macOS:
> brew install clang-format
> clang-format -style= GNU -dump-config > .clang-format

Then one could customize the .clang-format file based on their preferences.

Thanks

Re: Espressif-IDE v3.0.0 (stable) --- Can not get Code format to work

Posted: Sun Jun 23, 2024 4:25 pm
by elettronica67
All perfectly clear, thank you so much!