Using Arduino Language Server with PlatformIO in Neovim possible?

Hi!

I’m currently using Neovim with the Arduino Language Server (arduino-language-server) for my .ino projects, and it’s working really well.

Since switching to PlatformIO, which offers a much more convenient workflow, I’ve been wondering if I can still use all the features of the Arduino Language Server within my PlatformIO projects. Simply using Clang doesn’t work, as it doesn’t support all the specific Arduino-related aspects.

So far, I’ve tested configurations with filetypes and lspconfig, but haven’t had any success. I got a root directory not found in LspInfo

Is there a way to integrate the Arduino Language Server with PlatformIO in Neovim?

local lspconfig = require("lspconfig")
lspconfig.arduino_language_server.setup({
  cmd = {
    "local/arduino-language-server/arduino-language-server",
  },
  filetypes = { "arduino", "ino", "cpp" },
})

LspInfo on a platformio project

 executable:        true
  autostart:         true
  root directory:    ~/Downloads/mysektch/Not found.