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: expose Arduino state to VS Code extensions #2110

Merged
merged 3 commits into from
Jul 5, 2023

Conversation

dankeboy36
Copy link
Contributor

@dankeboy36 dankeboy36 commented Jun 21, 2023

The follow-up PR of #2071.

Motivation

To provide a way to implement external tools for the Arduino IDE without modifying the IDE codebase. See #58.

This PR introduces a tiny layer of code to listen to Arduino context-related changes and set it on the VS Code extension. Other VS Code extensions can import this new VSIX API and retrieve context information from the Arduino IDE—information such as the sketch path, FQBN of the currently selected board, etc. See vscode-arduino-api for more details.

I have an ongoing reference re-implementation of the well-known ESP exception decoder. It works in the Arduino IDE.

Change description

  • Update a shared state on fqbn, port, sketch path, and etc. changes. VS Code extensions can access it and listen on changes.
  • Force VISX activation order: API VSIX starts first.

Other information

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

 - Update a shared state on fqbn, port, sketch path, and etc. changes.
VS Code extensions can access it and listen on changes.
 - Force VISX activation order: API VSIX starts first.

Signed-off-by: dankeboy36 <[email protected]>
Removed the toolbar contribution from the UI.

Ref: eclipse-theia/theia#12626/
Signed-off-by: dankeboy36 <[email protected]>
@dankeboy36 dankeboy36 force-pushed the set-arduino-context branch from b36448b to 18366e2 Compare June 28, 2023 08:05
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Akos!

Copy link
Contributor

@AlbyIanna AlbyIanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the code, and looks fine to me! 👍
Just left an unimportant comment but it's not blocking.

@@ -0,0 +1,23 @@
import { injectable } from '@theia/core/shared/inversify';
import { TerminalWidgetImpl as TheiaTerminalWidgetImpl } from '@theia/terminal/lib/browser/terminal-widget-impl';
import debounce from 'p-debounce';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that in most files in the project we're using lodash.debounce, while only in one other file than this one we are using p-debounce. Maybe it makes sense to stick to one of them and remove a dependency from the project.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for noticing it; I did not. It's because the change is the "cherry-pick" of the upstream fix, which uses p-debounce. See here: eclipse-theia/theia@6ab16d5#diff-da3ea75041150eb2403247c5ed84542210774c326c0e3b334029f4e3afb51fc0R45.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants