mirror of
https://github.com/We-Dont-Byte/Mind_Reader.git
synced 2025-02-04 10:38:42 +00:00
Rather than queuing inbound messages, the HubController now saves pending promises/rejects for each pending request. Each inbound packet is checked at the time of arrival, and if the ID matches a pending response, the corresponding promise is called. This fixes a problem where the longer the time between reads, the more garbage responses queue up that are guaranteed to get thrown away the next time the next response was gathered.
38 lines
1009 B
TypeScript
38 lines
1009 B
TypeScript
import * as vscode from 'vscode';
|
|
|
|
import * as pl from './pylex';
|
|
import commands from './commands';
|
|
|
|
import AccessNodeProvider from './accessNodeProvider';
|
|
|
|
// create output channel
|
|
const outputChannel = vscode.window.createOutputChannel("SPIKE Prime Output");
|
|
|
|
export function MindReaderOutput(line: string) {
|
|
outputChannel.show();
|
|
outputChannel.appendLine(line);
|
|
}
|
|
|
|
let parser: pl.Parser = new pl.Parser();
|
|
|
|
export function activate(context: vscode.ExtensionContext) {
|
|
console.log('Congratulations, your extension "mind-reader" is now active!');
|
|
vscode.window.showInformationMessage('Mind_Reader is loaded!');
|
|
|
|
parser.parse('Beep Boop');
|
|
|
|
// Register Commands
|
|
commands.forEach(command => {
|
|
let disposable = vscode.commands.registerCommand(
|
|
command.name,
|
|
command.callback
|
|
);
|
|
context.subscriptions.push(disposable);
|
|
});
|
|
|
|
let provider = new AccessNodeProvider();
|
|
vscode.window.registerTreeDataProvider('accessActions', provider);
|
|
}
|
|
|
|
export function deactivate() {}
|