Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSP cannot find definitions from std libraries in the toolchain #190

Open
3 tasks done
saippua opened this issue Jul 20, 2024 · 0 comments
Open
3 tasks done

LSP cannot find definitions from std libraries in the toolchain #190

saippua opened this issue Jul 20, 2024 · 0 comments
Labels
type: imperfection Perceived defect in any part of project

Comments

@saippua
Copy link

saippua commented Jul 20, 2024

Describe the problem

Here is a very simple example which compiles and runs on my ESP32.

// #include <stdint.h> // not necessary to build.

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

    uint8_t value = 42;
    Serial.println(value);
}

void loop() {
}

Arduino LSP complains Unknown type name 'uint8_t' in the setup() function.

To reproduce

I have Arduino LSP (0.7.6) setup on a downgraded Neovim v0.9.5 with semantic tokens disabled as per #186 (comment)

Also installed: clangd v17.0.6

I have tried creating a compilation database with arduino-cli. From there I can see that ~/.arduino15/packages/esp32/tools/esp-x32/2302/bin/xtensa-esp32-elf-g++ is being used for compilation. stdint.h is part of that toolchain, so I don't know why arduino LSP is not finding it, even though arduino-cli clearly does find it, because the code compiles.

Expected behavior

Arduino LSP should find dependencies from the toolchain automatically, or there should be some way to manually specify the toolchain, like with clangd's --query-driver

Arduino Language Server version

0.7.6

Arduino CLI version

0.35.3

Operating system

Linux

Operating system version

NixOS 2.18.4

Additional context

I am using the esp32 core (esp32:esp32, v3.0.1)

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details
@saippua saippua added the type: imperfection Perceived defect in any part of project label Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

1 participant