-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 infor 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |