mirror of
https://github.com/We-Dont-Byte/Mind_Reader.git
synced 2024-11-15 03:35:59 +00:00
John
de3c9bf435
- Start work on ev3 support - Explore functionality of ev3dev-Browser - Realize it's super limited
31 lines
946 B
TypeScript
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;
|
|
}
|
|
});
|
|
}
|
|
} |