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

Missing support for external tools / plugins #58

Open
3 tasks done
szerwi opened this issue Feb 12, 2021 · 53 comments
Open
3 tasks done

Missing support for external tools / plugins #58

szerwi opened this issue Feb 12, 2021 · 53 comments
Labels
criticality: high Of high impact topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@szerwi
Copy link

szerwi commented Feb 12, 2021

Describe the solution you'd like
I would like to propose support for external tools / plugins which are compatible with Arduino IDE. Ex. https://github.com/me-no-dev/arduino-esp32fs-plugin or https://github.com/me-no-dev/EspExceptionDecoder
If it is already supported, how can I use tools in Pro IDE?
If it is not supported yet, are there any plans for implementing that?

Describe the problem

There is no support for extending the capabilities of Arduino IDE via external tools/plugins. This is a feature parity mismatch with Arduino IDE 1.x.

To reproduce

  1. Follow the instructions to install the "Arduino Pico LittleFS Filesystem Uploader" plugin:
    https://github.com/earlephilhower/arduino-pico-littlefs-plugin#installation
  2. Start Arduino IDE 2.x
  3. Open the Tools menu.

🐛 The expected "Pico LittleFS Data Upload" menu item is missing.

Expected behavior

Support for extending the capabilities of Arduino IDE via external tools/plugins equivalent to the system provided by Arduino IDE 1.x.

Arduino IDE version

Original report

2.0.0-beta.1

Last verified with

2.0.2

Operating system

All

Operating system version

any

Additional context

Additional reports

Related

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@ubidefeo
Copy link

@szerwi
we have long had this in our list, but the pre-existing tools are built on Java and the new IDE is built on Electron.
In order to implement tools, we should offer entry points for those and developers should follow guidelines to write such tools in JS, or make them binary executables that could be launched.
We're not there yet, but this particular instance, the ESP exception decoder, is one of the most used tools out there :)

@szerwi

This comment was marked as off-topic.

@ubidefeo

This comment was marked as off-topic.

@igrr
Copy link

igrr commented Oct 18, 2021

Hi, I'd like to mention that for the ESP-specific plugins, we are open to rewriting them in any language required for integration with Arduino IDE v2.0.

We are also open to some more limited or localized plugin functionality. For example, for the exception decoder it would be sufficient if we could add a core-specific "filter" tool which could take serial data from stdin and annotate with any additional information, and send that to stdout. The IDE could then launch this process in the background.

If some direction is given by the Arduino team, we can also contribute PRs to support these features.

@ubidefeo
Copy link

Thank you @igrr
We're really happy to see this comment.
We'll discuss this internally to figure out what's the best plan of action and get back to you.
Right now we don't have an API for plugins, but it's been in our bucket-list for a while.
I need to talk to the team to see if we can leverage a VS Code Extension kind of workflow to get started,
give us some time to talk this.
Thanks again 🙏🏼

@rsora rsora changed the title Support for external tools / plugins Missing support for external tools / plugins Oct 25, 2021
@rsora rsora added type: imperfection Perceived defect in any part of project priority: high Resolution is a high priority topic: code Related to content of the project itself and removed type: enhancement Proposed improvement labels Oct 25, 2021
@rsora
Copy link
Contributor

rsora commented Oct 25, 2021

This is actually an "IDE 2.0 vs IDE 1.x" feature parity item, I re-arranged the title and the labeling 🐱

@PaulStoffregen
Copy link

Just want to chime in, that Teensy needs this functionality for a tool which manages keys for code security.

sec

I'm can rewrite in whatever language and API are needed...

@roberttidey

This comment was marked as off-topic.

@mrWheel
Copy link

mrWheel commented Mar 27, 2022

Also the esp8266/esp32 data upload tools (spiffs and LittleFS) are missing. Without them using/testing the 2 rc5 IDE is useless for me :-(

@igrr
Copy link

igrr commented Sep 15, 2022

@ubidefeo @per1234 Congrats on reaching the Arduino IDE 2.0 release milestone!

I wanted to check if you could give any direction with regards to this issue? As I mentioned in #58 (comment), Espressif is willing to contribute this functionality, since it's the main hurdle for our users in migrating to Arduino IDE 2.0. Any suggestion from you would be really valuable.

@JimDrewGH

This comment was marked as duplicate.

@kittaakos

This comment was marked as duplicate.

@frank26080115
Copy link

oh cool, I see a pull request working on this #1893 thanks @radurentea

I have no experience with node.js or electron but this pull request can be an example I learn from.

@rtek1000

This comment was marked as duplicate.

@frank26080115

This comment was marked as duplicate.

@rtek1000

This comment was marked as off-topic.

@holgerlembke

This comment was marked as off-topic.

@Quency-D
Copy link

I wrote a test plug-in with reference to GitHub - dankeboy36/esp-exception-decoder: ESP8266/ESP32 Exception Decoder Extension for the Arduino IDE. It works very well under vscode, but does not work in Arduino 2.2.1.

The main difference is that the terminal.sendText function does not work on Arduino.

As far as I know, the terminal displays only keyboard input and terminal.sendText . Now terminal.sendText cannot be used. Is there any other way for me to display data to the terminal?

Here is the link to the published test firmware, Arduino-helloworld - Visual Studio Marketplace.

import { stringify } from 'querystring';
import * as vscode from 'vscode';

class  pseudoterminalTest implements vscode.Pseudoterminal{
	readonly onDidWrite: vscode.Event<string>;
	readonly onDidClose: vscode.Event<number | void>;
  
	private readonly onDidWriteEmitter: vscode.EventEmitter<string>;
	private readonly onDidCloseEmitter: vscode.EventEmitter<number | void>;
	private readonly toDispose: vscode.Disposable[];
  
	constructor(){
		this.onDidWriteEmitter = new vscode.EventEmitter<string>();
		this.onDidCloseEmitter = new vscode.EventEmitter<number | void>();
		this.toDispose = [
			this.onDidWriteEmitter,
			this.onDidCloseEmitter,
		  ];
		  this.onDidWrite = this.onDidWriteEmitter.event;
		  this.onDidClose = this.onDidCloseEmitter.event;
	}
	open(): void{
		this.onDidWriteEmitter.fire("open");
	}
	close(): void{
		
	}
	
	handleInput(data: string): void {
		this.onDidWriteEmitter.fire(data);
	}
}

const pty = new pseudoterminalTest();
// This method is called when your extension is activated
// Your extension is activated the very first time the command is executed
export function activate(context: vscode.ExtensionContext) {

	console.log(' your extension "helloworld" is now active!');

	let disposable = vscode.commands.registerCommand('helloworld.helloworld', () => {
		const options: vscode.ExtensionTerminalOptions = {
				name: 'hello_terminal',
				pty,
				iconPath: new vscode.ThemeIcon('debug-console'),
			};
		let terminal: vscode.Terminal;
		terminal=vscode.window.createTerminal(options);
		terminal.show();
		terminal.sendText('\x1b[31mHello world\x1b[0m',true);
	});
	context.subscriptions.push(disposable);
}

@dankeboy36
Copy link
Contributor

dankeboy36 commented Sep 19, 2023

Here is the link to the published test firmware

Hi, if you link the repo to the source code, I can look at it.


Update:
🧵 continues at Quency-D/esp-network-monitor#1.

@Quency-D
Copy link

@dankeboy36
I just uploaded the code, please help me take a look.
https://github.com/Quency-D/esp-network-monitor-port

@rdragonrydr

This comment was marked as resolved.

@per1234
Copy link
Contributor

per1234 commented Sep 20, 2023

Are we just bundling VSCode, or porting the store/large parts of it?

Arduino IDE 2.x is built on the Eclipse Theia IDE framework. Theia supports VS Code extensions:

https://theia-ide.org/docs/authoring_vscode_extensions/

So Arduino IDE 2.x had support for VS Code extensions all along, and in fact the stock Arduino IDE installation already makes heavy use of extensions. No additional work is needed on Arduino IDE codebase for VS Code extension support.

Even though the VS Code extension system makes it possible to do quite a lot in adding additional capabilities to Arduino IDE, in order to accomplish the equivalent to what is done in some of the Arduino IDE 1.x "plugin" tools, the extension also needs access to the Arduino-specific data known to Arduino IDE/Arduino CLI. The lack of access to such data has been the technical blocker for creating VS Code extension replacements for the Arduino IDE 1.x "plugin" tools. That missing capability was recently added: #2110

So from a technical standpoint we can close this issue as resolved. The outstanding task for Arduino is documenting:

  • The fact that adding additional capabilities to Arduino IDE by 3rd parties is possible through VS Code extensions.
  • The availability of Arduino state data to extensions via an API

I would like to keep the thread here very tightly focused. For less structured discussion of the subject, please feel free to create a topic on Arduino Forum. I'll be happy to participate over there:

https://forum.arduino.cc/

@igrr
Copy link

igrr commented Sep 21, 2023

The outstanding task for Arduino is documenting:

The fact that adding additional capabilities to Arduino IDE by 3rd parties is possible through VS Code extensions.

Could you also consider adding the user-facing instructions for installing extensions (e.g. which directory they have to be dropped into, depending on the platform) as part of this task?

Another question I had regarding the plugins API: can the plugin developers expect that the API (vscode-arduino-api) major version will change together with the IDE major version? In other words, can we assume that no breaking changes would be introduced in the API for the v2.x branch of the IDE?

@kittaakos
Copy link
Contributor

Could you also consider adding the user-facing instructions for installing extensions

It is a good idea to clarify explicitly. However, installing any VS Code extension in IDE2 is the same procedure as adding a custom theme. It's already documented here.

depending on the platform

All extensions should go into the same folder, independently from the platform.

can the plugin developers expect that the API (vscode-arduino-api) major version will change together with the IDE major version?

No, this is very unlikely. I doubt Arduino IDE 3.x will come soon, but we might need to apply breaking changes in the API and increment the major version. Also, there is a plan to use vscode-arduino-api outside of IDE2. However, I will keep a migration guide if breaking changes are inevitable.

@igrr
Copy link

igrr commented Sep 22, 2023

It's already documented here.

I have totally missed this page, sorry about that! Indeed, it already includes everything necessary. So simply updating the page to mention "extensions" along with "themes" is enough.

independently from the platform

I just meant the specific directories where the extensions should be placed on Windows/Linux/macOS — which is already described in the page you linked, so all good.

However, I will keep a migration guide if breaking changes are inevitable.

Thanks! That plus some method for runtime API version detection would also work fine. Essentially, as a plugin author I might want to support multiple IDE minor versions (with semver-incomplatible APIs) in a single plugin package release.

@kittaakos
Copy link
Contributor

kittaakos commented Sep 22, 2023

Thanks! That plus some method for runtime API version detection would also work fine. Essentially, as a plugin author I might want to support multiple IDE minor versions (with semver-incomplatible APIs) in a single plugin package release.

Absolutely. This has been requested internally, too. The implementation has yet to be decided. Since all Arduino IDE extensions will be VS Code extensions, I would keep the Arduino IDE API compatibility check mechanism close to the VS Code one and use the engines field in the extension manifest (the package.json in this case).

Something like this could work:

package.json:

{
  "name": "your extension name",
   // other props
  "engines": {
    "vscode": "^1.78.0",
    "vscode-arduino-api": "^0.1.2" // <-- IDE2 will assert whether your extension is compatible with the runtime
  },
  // rest of your extension's package.json
}

@bmentink

This comment was marked as duplicate.

@dlarue

This comment was marked as off-topic.

@arduino arduino locked as too heated and limited conversation to collaborators Oct 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
criticality: high Of high impact topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests