Mind_Reader/src/extension.ts
jakergrossman 92d42edaff Parse messages on arrival
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.
2021-11-18 00:29:27 -06:00

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() {}