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

feat: multi sketch folders support #12

Merged
merged 13 commits into from
Dec 29, 2023
Merged

feat: multi sketch folders support #12

merged 13 commits into from
Dec 29, 2023

Conversation

dankeboy36
Copy link
Owner

@dankeboy36 dankeboy36 commented Dec 28, 2023

This PR supports multiple sketch folders opened in the same workspace.

Although the Arduino IDE can open only one sketch at a time, no technical obstacles exist to support multi-root workspaces with any number of opened sketch folders in a single (Arduino IDE, VS Code) window.

Added:

  • get the current sketch,
  • receive an event when the current sketch changes,
  • get all opened sketch folders in the window,
  • get an event when the opened sketch folders change,
  • receive an event when the data folder (directories.data) or sketchbook location (directories.user) changes,
  • receive an event when the selected board, port, etc., per sketch changes

Changed:

All existing APIs will be deprecated but kept backward-compatible!

  • deprecate existing APIs,
  • merged the boardDetails and the fqbn into board:
    • when no board is selected, it's undefined,
    • when the board is selected, but the platform is not installed, only the board name is available: { name: "ABC", fqbn: undefined }
    • when the board is detected on a discovered port, but the platform is not installed, it's { name: "ABC", fqbn: "a:b:c" },
    • when the platform is installed, it's a complete BoardDetails object with the fqbn, name, programmers, etc.

Tests:

TODOs:

  • Document + test API migration. For example, use context.currentSketch?.board?.fqbn instead of context.fqbn.

@dankeboy36 dankeboy36 added the enhancement New feature or request label Dec 28, 2023
@dankeboy36 dankeboy36 marked this pull request as ready for review December 29, 2023 17:39
Signed-off-by: dankeboy36 <[email protected]>
@dankeboy36 dankeboy36 merged commit 4d87fab into main Dec 29, 2023
5 checks passed
@dankeboy36 dankeboy36 deleted the multi-sketch-folder branch December 29, 2023 17:44
dankeboy36 pushed a commit that referenced this pull request Dec 29, 2023
# [0.2.0](0.1.2...0.2.0) (2023-12-29)

### Features

* multi sketch folders support ([#12](#12)) ([4d87fab](4d87fab))
* **release:** automate release ([#4](#4)) ([cb414b0](cb414b0))
@dankeboy36
Copy link
Owner Author

🎉 This PR is included in version 0.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant