[client] exeute command

This commit is contained in:
2021-04-17 23:03:40 +05:30
parent ed83e649fb
commit d7d48785aa
16 changed files with 1298 additions and 16 deletions

View File

@@ -5,7 +5,7 @@
import * as path from 'path';
import { workspace, ExtensionContext,commands, window } from 'vscode';
import {runBF} from './bfExecutor';
import {
LanguageClient,
LanguageClientOptions,
@@ -42,6 +42,16 @@ export function activate(context: ExtensionContext) {
documentSelector: [{ scheme: 'file', language: 'bf' }]
};
const command = 'bf.execute';
const commandHandler = async()=>{
const text= window.activeTextEditor.document.getText();
const fn = window.activeTextEditor.document.fileName;
const input = await window.showInputBox({prompt:'Enter input (If not enough, program will assume 0)'});
const output = await runBF(text,fn,input);
await window.showInformationMessage(`Output: ${output}`);
};
context.subscriptions.push(commands.registerCommand(command,commandHandler));
// Create the language client and start the client.
client = new LanguageClient(