Mind_Reader/src/ev3Manager.ts
John de3c9bf435 ev3Manager:
- Start work on ev3 support
- Explore functionality of ev3dev-Browser
- Realize it's super limited
2022-04-09 21:19:11 -05:00

31 lines
946 B
TypeScript

import * as vscode from 'vscode';
//import * as fs from 'fs';
//import { logger } from './extension';
export default class EV3Manager {
private ev3devBrowser: vscode.Extension<any> | undefined = vscode.extensions.getExtension("ev3dev.ev3dev-browser");
private constructor() {}
public test() {
//console.log(this.ev3devBrowser);
// This seems to be the only thing we, as an extension,
// are allowed to do with this other extension.
vscode.commands.executeCommand("ev3devBrowser.action.pickDevice", null);
}
public static activate(): Promise<EV3Manager> {
return new Promise (async (resolve) => {
try {
let mgr = new EV3Manager();
// Wait for ev3devBrowser to start
await mgr.ev3devBrowser?.activate();
// Return ev3Manager
return resolve(mgr);
}
catch (err) {
throw err;
}
});
}
}