platformio / platformio-core

Your Gateway to Embedded Software Development Excellence :alien:
https://platformio.org
Apache License 2.0
7.95k stars 792 forks source link

Neovim Clangd Error #4988

Closed smarbo closed 1 month ago

smarbo commented 1 month ago

What kind of issue is this?


Configuration

Operating system: Ubuntu

PlatformIO Version (platformio --version): PlatformIO Core, version 6.1.17a1

Description of problem

I am using Neovim with a bunch of LSP setup and I have installed clangd. Firstly, it was showing errors such as 'Arduino.h not found' and stuff like that, but I found a way to fix that. However, it is now showing a new error, shown in the below image. image

Steps to Reproduce

  1. pio project init --board esp32dev --ide vim
  2. create the extra_script.py and all that to create the compile_commands.json
  3. nvim src/main.cpp

Actual Results

image

Expected Results

image

If problems with PlatformIO Build System:

The content of platformio.ini:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
extra_scripts = pre:extra_script.py

Source file to reproduce issue:

#include <Arduino.h>

void setup() { Serial.begin(115200); }

void loop() { Serial.println("Hello, world!"); }

Additional info

smarbo commented 1 month ago

After building and uploading it to my ESP32, the error is gone and everything works as normal.