Hello, I’m trying to use clangd as an LSP. I did pio run -t compiledb and it removed every red underline except for ones where I call Serial.println and Serial.print. Thing is, Serial.begin doesn’t have a red underline.
How do I fix this? Here’s what it prints out if I hover over the red underline. It’s for Serial.println, but it outputs the exact same log for Serial.print
Error log
No matching member function for call to 'println'clang(ovl_no_viable_member_function_in_call)
Print.h(98, 12): Candidate function not viable: no known conversion from 'HardwareSerial' to 'Print' for object argument
Print.h(97, 12): Candidate function not viable: no known conversion from 'HardwareSerial' to 'Print' for object argument
Print.h(96, 12): Candidate function not viable: no known conversion from 'HardwareSerial' to 'Print' for object argument
Print.h(99, 12): Candidate function not viable: no known conversion from 'HardwareSerial' to 'Print' for object argument
Print.h(100, 12): Candidate function not viable: no known conversion from 'HardwareSerial' to 'Print' for object argument
Print.h(101, 12): Candidate function not viable: no known conversion from 'HardwareSerial' to 'Print' for object argument
Print.h(102, 12): Candidate function not viable: no known conversion from 'HardwareSerial' to 'Print' for object argument
Print.h(103, 12): Candidate function not viable: no known conversion from 'HardwareSerial' to 'Print' for object argument
Print.h(104, 12): Candidate function not viable: no known conversion from 'HardwareSerial' to 'Print' for object argument
Print.h(105, 12): Candidate function not viable: no known conversion from 'HardwareSerial' to 'Print' for object argument
Print.h(106, 12): Candidate function not viable: no known conversion from 'HardwareSerial' to 'Print' for object argument
Print.h(107, 12): Candidate function not viable: no known conversion from 'HardwareSerial' to 'Print' for object argument
Print.h(108, 12): Candidate function not viable: no known conversion from 'HardwareSerial' to 'Print' for object argument
Print.h(109, 12): Candidate function not viable: no known conversion from 'HardwareSerial' to 'Print' for object argument
Print.h(110, 12): Candidate function not viable: requires 0 arguments, but 1 was provided
instance-method println
provided by "Print.h"
---
→ size_t (aka unsigned long)Parameters:
* const \__FlashStringHelper \* ifsh
---
// In Printpublic: size_t println(const \__FlashStringHelper \*ifsh)
Here are the versions I’m on
> clangd --version
clangd version 21.1.6
Features: linux
Platform: x86_64-pc-linux-gnu
> pio --version
PlatformIO Core, version 6.1.18
Also, the code runs just fine with pio run. It’s just the LSP that’s screaming.