PlatformIO-Mode icon indicating copy to clipboard operation
PlatformIO-Mode copied to clipboard

Eglot

Open Spidy104 opened this issue 3 years ago • 1 comments

I use clangd as my auto completion engine, how do we integrate it or is there not any support at all and how do we install and use new libraries?

Spidy104 avatar Nov 19 '21 18:11 Spidy104

Hello @Spidy104,

The maintainers can be more specific, but I think PlatformIO supports only clang-tidy.

I use clangd with Eglot too, and I simply manually "convert" the .ccls file, auto-generated by compilation process, to a .clangd one.

A line like the following in a .ccls file:

%c -std=gnu11 -fno-fat-lto-objects -Os -Wall -ffunction-sections -fdata-sections -flto -mmcu=atmega328p

Would become, in the .clangd one:

---                             # Compiler arguments when parsing C files
If:
  PathMatch: .*\.c
CompileFlags:
  Add: [-std=gnu11, -fno-fat-lto-objects, -Os, -Wall, -ffunction-sections, -fdata-sections, -flto, -mmcu=atmega328p]

You can find more info about those parameters in https://clangd.llvm.org/config.

I believe that an "auto-converter" would be a great addition to the code, besides not seeming too complex to implement.

fernandodemorais-jf avatar Dec 05 '22 12:12 fernandodemorais-jf