Skip to content

Commit

Permalink
feat: add "Install Hermione" action
Browse files Browse the repository at this point in the history
  • Loading branch information
DudaGod committed Mar 27, 2024
1 parent a827c68 commit da5138a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
# vscode-hermione
Integration Hermione with VS Code

This extension supports [Hermione][hermione] features in VS Code environment. Available features:

- [Install Hermione](#install-hermione)
- [Using the REPL mode][#using-the-repl-mode]

## Install Hermione

If you are not using hermione yet or starting a new testing project, the "Install Hermione" action from the command panel will help you get started.

## Using the REPL mode

Adds a keybinding (`cmd+shift+8` for mac and `ctrl+shift+8` for others) to run a dedicated section of code in the VSCode terminal. More info about [REPL mode][hermione-repl-mode]. You can overwrite this keybinding in [keyboard shortcuts][vscode-keyboard-shortcuts].

[hermione]: https://github.com/gemini-testing/hermione
[hermione-repl-mode]: https://github.com/gemini-testing/hermione?tab=readme-ov-file#repl-mode
[vscode-keyboard-shortcuts]: https://code.visualstudio.com/docs/getstarted/keybindings
23 changes: 23 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as vscode from "vscode";

export function activate(context: vscode.ExtensionContext): void {
const disposable = vscode.commands.registerCommand("hrm.install", async () => {
const [workspaceFolder] = vscode.workspace.workspaceFolders || [];
if (!workspaceFolder) {
await vscode.window.showErrorMessage("Open a folder in VS Code to initialize Hermione");
return;
}

const terminal = vscode.window.createTerminal({
name: "Install Hermione",
cwd: workspaceFolder.uri.fsPath,
env: process.env,
});

terminal.show();

terminal.sendText(`npm init hermione-app -- --yes`, true);
});

context.subscriptions.push(disposable);
}

0 comments on commit da5138a

Please sign in to comment.