# coc-gauge

> Gauge support for coc.nvim

Latest version **0.2.2** (published 2021-03-21) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install coc-gauge
pnpm add coc-gauge
yarn add coc-gauge
bun add coc-gauge
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2021-03-21 |
| First published | 2020-10-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Naoki.M |
| Maintainers | navel3 |
| Keywords | coc.nvim |

## Links

- npm: https://www.npmjs.com/package/coc-gauge
- Repository: https://github.com/navel3/coc-gauge
- Homepage: https://github.com/navel3/coc-gauge#readme
- Issues: https://github.com/navel3/coc-gauge/issues
- npm.io page: https://npm.io/package/coc-gauge

## Recent versions

- 0.2.2 (latest) — 2021-03-21
- 0.2.1 — 2020-10-07
- 0.2.0 — 2020-10-06
- 0.1.0 — 2020-10-06
- 0.0.0-development — 2020-10-06

## README

# coc-gauge

Gauge language server extension for [coc-nvim](https://github.com/neoclide/coc.nvim).

[Gauge](https://gauge.org/) is a light-weight cross-platform test automation tool.

**Notes:**
- This is not an official repository by Gauge project.  
- Some code blocks are taken from [coc-nvim](https://github.com/neoclide/coc.nvim) and [gauge-vscode](https://github.com/getgauge/gauge-vscode)
- Currently, I'm checking only JavaScript as step implementation language, but others may work.

## Motivation

The `gauge` command offers language server feature, so you can use it's featue with just setup coc config like below.

```json
{
  "languageserver": {
    "gauge": {
      "command": "gauge",
      "args": ["daemon", "--lsp", "--dir", "."],
      "filetypes": ["spec"],
      "rootPatterns": ["manifest.json"]
    }
  }
}
```

However, it lacks many features compared to gauge-vscode.  
By using this extension, you can get the below features in neovim/vim!

- Running tests
- Debugging tests
- Renaming step (It works just using the LSP, but is insufficient)
- Listing locations that refer a step

## Install

`:CocInstall coc-gauge`

## Commands And Keymaps

| Command                            | \<Plug\>(keymap)                      | Description                         |
|------------------------------------|---------------------------------------|-------------------------------------|
| coc-gauge.runAll                   | coc-gauge-run-all                     | Run all specs                       |
| coc-gauge.runSpec                  | coc-gauge-run-spec                    | Run spec opened in current buffer   |
| coc-gauge.runScenarioUnderCursor   | coc-gauge-run-scenario-under-cursor   | Run scenario under the cursor       |
| coc-gauge.runRepeat                | coc-gauge-run-repeat                  | Run with last launched config       |
| coc-gauge.debugAll                 | coc-gauge-debug-all                   | Debug all specs                     |
| coc-gauge.debugSpec                | coc-gauge-debug-spec                  | Debug spec opened in current buffer |
| coc-gauge.debugScenarioUnderCursor | coc-gauge-debug-scenario-under-cursor | Debug scenario under the cursor     |
| coc-gauge.debugRepeat              | coc-gauge-debug-repeat                | Debug with last launched config     |
| coc-gauge.stop                     | coc-gauge-stop                        | Stop runnning gauge test            |
| coc-gauge.renameStep               | coc-gauge-rename-step                 | Rename step under the cursor (\*)    |
| coc-gauge.restartGaugeService      | coc-gauge-restart-service             | Restart Gauge language server       |


*: You can also rename a step by executing `CocAction('coc-rename')`, but it does
not work properly, because coc.nvim renaming command uses `<cword>` to get the
name, but step name is generally separated by space characters.

## Config

- coc-gauge.enable(default: true)  
  Enable this extention.
- coc-gauge.verbose(default: false)  
  Run gauge command with '--verbose' option.
- coc-gauge.coc-gauge.autoScrollOutputWindow(default: false)
  [Experimental] Automatically scroll the output window to the bottom.

## Debug

[vimspector](https://github.com/puremourning/vimspector) is required to be
installed for debugging.

Place the following json file as `<project-root>/.vimspector.json` for
debugging.

```json
{
  "configurations": {
    "run": {
      "adapter": "vscode-node",
      "configuration": {
        "request": "attach",
        "stopOnEntry": true,
        "protocol": "inspector",
        "console": "integratedTerminal"
      },
      "breakpoints": {
        "exception": {
          "all": "N",
          "caught": "",
          "uncaught": "Y"
        }
      }
    }
  }
}
```

The exception part is important! If you don't set the part, vimspector asks you
some questions before attaching the session. However, Gauge wait for just 1
second. Therefore, during the dialogue, Gauge gives up waiting for attaching
from debugging session, then resume running without any breakpoints.

## Autocommands

`filetype=spec` is set on event `BufEnter *.cpt`.

## Videos

Run
![run](./doc/images/run.gif)

Debug
![debug](./doc/images/debug.gif)

Jump step references
![jump](./doc/images/jumpReferences.gif)

Rename step
![rename](./doc/images/renameStep.gif)

## License

MIT

---

> This extension is created by [create-coc-extension](https://github.com/fannheyward/create-coc-extension)

---
_Source: https://npm.io/package/coc-gauge · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
