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

DesignerRick
Posts: 7
Joined: Sun May 14, 2017 8:45 am

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

Postby DesignerRick » 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

elettronica67
Posts: 3
Joined: Sat Jun 08, 2024 4:40 pm

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

Postby elettronica67 » Sat Jun 08, 2024 5:01 pm

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

ESP_aliazamrana
Posts: 7
Joined: Wed Nov 10, 2021 11:01 am

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

Postby ESP_aliazamrana » Fri Jun 14, 2024 8:04 am

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

elettronica67
Posts: 3
Joined: Sat Jun 08, 2024 4:40 pm

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

Postby elettronica67 » Sat Jun 22, 2024 1:11 pm

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

ESP_kondalkolipaka
Posts: 188
Joined: Wed Jul 17, 2019 5:26 pm

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

Postby ESP_kondalkolipaka » Sun Jun 23, 2024 3:08 pm

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.

ESP_kondalkolipaka
Posts: 188
Joined: Wed Jul 17, 2019 5:26 pm

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

Postby ESP_kondalkolipaka » Sun Jun 23, 2024 4:07 pm

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

elettronica67
Posts: 3
Joined: Sat Jun 08, 2024 4:40 pm

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

Postby elettronica67 » Sun Jun 23, 2024 4:25 pm

All perfectly clear, thank you so much!

Who is online

Users browsing this forum: No registered users and 41 guests