Files
bf-server/client/src/command/CompileBranFlakesCommand.ts

30 lines
1023 B
TypeScript
Raw Normal View History

2024-01-02 17:15:19 +05:30
import { window } from 'vscode';
2024-01-02 22:32:24 +05:30
import type { BranFlakesCommand } from './BranFlakesCommand';
2024-01-02 17:15:19 +05:30
import { VSCodePromptInputStrategy } from '../input/VSCodePromptInputStrategy';
export class CompileBranFlakesCommand implements BranFlakesCommand {
getCommandName() {
return 'bf.execute';
}
getCommandHandler() {
return async () => {
const text = window.activeTextEditor.document.getText();
const fn = window.activeTextEditor.document.fileName;
const inputStrategy = new VSCodePromptInputStrategy(
window.showInputBox
);
2024-01-02 22:32:24 +05:30
const { BranFlakesExecutorVisitor } = await import(
'../BranFlakesExecutorVisitor'
);
2024-01-02 17:15:19 +05:30
const output = await BranFlakesExecutorVisitor.run(
text,
fn,
inputStrategy,
window.showInformationMessage
);
await window.showInformationMessage(`Output: ${output}`);
};
}
}