Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Plugging an an arduino with VSCode open to a non-arduino project causes c++ and arduino files to be added to that project #1016

Closed
wilsonmfg opened this issue Apr 8, 2020 · 7 comments
Labels

Comments

@wilsonmfg
Copy link

the files are:
.vscode/arduino.json
.vscode/c_cpp_properties.json

these really do not belong in a nodejs or python project. the extension should check for an .ino file before adding them.

@hellyzh
Copy link
Contributor

hellyzh commented Apr 10, 2020

Is this because you used the command "Arduino: Examples" to open the project? If use Open Folder... to open the project, it should not add the files.

@wilsonmfg
Copy link
Author

no, the project in question is not an arduino project at all.

@adamm
Copy link

adamm commented Apr 10, 2020

I have the same issue.

It occurs when I plugin an esp32 dev kit and /dev/cu.SLAB_USBtoUART is created. It does not occur when I plug in an Arduino Uno or Nano (which create /dev/cu.usbserial-xxxxxxxx).

Screen Shot 2020-04-10 at 3 12 25 PM

What's interesting, when this issue occurs and my non-Arduino project is "hijacked" by the VS Arduino extension, the esp32 is being mis-identified as an esp8266, and the esp8266 README.md opens in a new tab.

@wilsonmfg what hardware are you connecting?

Mac OS: 10.13.6
Visual Studio: 1.44.0
VSCode Arduino: 0.3.0

@hellyzh hellyzh added the bug label Apr 13, 2020
@wilsonmfg
Copy link
Author

an adafruit Huzzah ESP8266.
is it possible there some code in the esp8266 board definition that's triggering vscode to do this?

@hellyzh
Copy link
Contributor

hellyzh commented Apr 14, 2020

Mis-identified esp32 is due to a hard code usb mapping, It may need to manually switching board after plugged device in. But for the wrongly added arduino files, they really should be only added to project with ".ino" file.

@adamm
Copy link

adamm commented Apr 15, 2020

I've found that I can workaround the issue and avoid the hijack by adding to global settings.json:
"arduino.enableUSBDetection": false
And restarting vscode.

@hellyzh
Copy link
Contributor

hellyzh commented Jun 9, 2020

Arduino Extension v0.3.1 is released with the fix to not add arduino files for non-Arduino project.

@hellyzh hellyzh closed this as completed Jun 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants