-
Notifications
You must be signed in to change notification settings - Fork 0
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
Arduino context doesn't populate until full build or opening of additional sketch #6
Comments
FWIW, ignoring the above I have a MVP (minimum viable product) level extension using this at https://github.com/earlephilhower/pico-littlefs-upload . So, thanks again @dankeboy36 ! It's still a WIP and took more time this afternoon than it looks (my first VS code extension, my first Typescript introduction). It's also probably the ugliest Typescript you've ever seen. 😭 The synchronous calls to the uploader take a long time and I really should learn how to make that async so the IDE doesn't freeze for 30 secs every time while it's sending. |
Hi @earlephilhower. Thanks for your report. This fault is caused by a bug in Arduino IDE (introduced by arduino/arduino-ide@69ae38e / arduino/arduino-ide#2165). I am able to reproduce the fault of Fortunately a fix has already been prepared: arduino/arduino-ide#2233. I am not able to reproduce the problem using the tester build from that PR. If you would like to give the fix a try, the tester builds are available from the "Assets" section of the build workflow run summary page here: https://github.com/arduino/arduino-ide/actions/runs/6262068930?pr=2233#artifacts It should also be in the nightly build of Arduino IDE within a matter of days. Workaround
Related: dankeboy36/esp-exception-decoder#10
Very cool! |
Very nice, @earlephilhower 💪
Thank you, too, for the other original (1.x) plugin implementations. By the way, I also started to work on something similar you've just done. I am happy to contribute to your project. I have enabled discussion in this repo: https://github.com/dankeboy36/vscode-arduino-api/discussions. Feel free to share and help grow the community. |
Looking at your own ESP32 repo, dankeboy36/fs-image@main...init, it seems like maybe there will need to be 2 separate uploaders anyway: one ESP32 and one Pico/ESP8266. Since I did the ESP8266 and the LittleFS implementation on both cores (and the upload methods) they're very similar (only ~20 lines of code differ between the two). But since I never really got into the ESP32 I didn't realize their setup is so different (partitions/etc.)! Plus they seem to support a FAT variant and SPIFFS on-flash as well, so a generic FS uploader there needs to know how to run |
First of all, thank you very much for building this! I've been getting requests for some of the plugins used w/arduino-pico like the LittleFS uploader to be ported to IDE 2.x.
As part of the uploader we run some external commands (like you do w/the ESP exception decoder you ported) that depend on some of the
build.xxx
properties (i.e. how large a filesystem, where it's located, what upload port, etc.).What I'm seeing is that when the IDE starts up and opens the sketch from last time, is that the
arduinoContext
only has three fields:If I open another sketch (but not build it), or run a build on the automatically opened sketch, the context seems to fully populate:
The uploader plugins don't have any need for a build before being run, but they do need properties like the
port
and thebuildProperties
to do their jobs.Is there a way to make the
arduinoContext
force-update from an end-user of the extension? Or is there a way to update this extension to populate it?MCVE extension.ts (basically helloworld from
yo code
):--edit--more testing--
I also attempted to grab the context on each command invocation thinking maybe I got a static copy of the context at a "bad time" during plug in initialization. That seems to make no difference, though, and only by building or opening another sketch can I get the state properly for the auto-opened sketch
--edit--even more testing--
The behavior is that the first auto-opened sketch does NOT get its data populated until a build. Switching from the auto-open sketch, to a different one, then back to the auto-opened sketch still does not give any additional fields. Only building populates its object.
The text was updated successfully, but these errors were encountered: