Skip to content

platformio created projects don't quite work in CDT LSP #443

Open
@jonahgraham

Description

@jonahgraham

@joaopedrotaveira provided instructions in #441 on how to setup a platformio project. These projects work in the classic CDT Editor, but run into a few problems for CDT LSP, at least out of the box.

Here are the instructions from #441, slightly modified.

  1. Install platformio as instructed here. Quick version is:
$ curl -fsSL -o get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py
# review what was downloaded
$ python3 get-platformio.py
$ export PATH=$PWD/.platformio/penv/bin:$PATH
  1. create project folder:
$ mkdir -p /tmp/platformio-blink-test-1
  1. Initialize a new project with some board, but specify eclipse as IDE
$ cd /tmp/platformio-blink-test-1
$ platformio project init --board esp32-s3-devkitc-1 --ide eclipse
  1. add basic example of code to src, example blink.cpp:
/**
 * Blink
 * Turns on an LED on for one second,
 * then off for one second, repeatedly.
 */
#include "Arduino.h"

void setup()
{
  // initialize LED digital pin as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop()
{
  // turn the LED on (HIGH is the voltage level)
  digitalWrite(LED_BUILTIN, HIGH);
  // wait for a second
  delay(1000);
  // turn the LED off by making the voltage LOW
  digitalWrite(LED_BUILTIN, LOW);
   // wait for a second
  delay(1000);
}
  1. one can see that eclipse project files are in the folder
$ ls -a
.
..
.cproject
.gitignore
.pio
.project
.settings
include
lib
platformio.ini
src
test
  1. open Eclipse for C/C++ Developers and import the project folder
  2. Build the project
  3. Open blink.cpp in the CDT Editor - observe everything works

screenshot of cdt editor with no warnings nor errors

  1. Click "try the new c/c++ editing experience" and reopen editors in CDT LSP Editor - observe many error and warning markers

screenshot of cdt lsp editor with warnings and errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions