Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve readme and feature demonstration #41

Merged
merged 1 commit into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 28 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

Ruby LSP RSpec is a [Ruby LSP](https://github.com/Shopify/ruby-lsp) addon for displaying CodeLens for RSpec tests.

![Screenshot of the code lenses](/misc/example.gif)

## Installation

To install, add the following line to your application's Gemfile:
Expand All @@ -19,14 +17,36 @@ end

After running `bundle install`, restart Ruby LSP and you should start seeing CodeLens in your RSpec test files.

## Usages (with VS Code)
## Features

### CodeLens

1. When clicking `Run`, the test(s) will be executed via the Test Explorer
- However, deeply nested tests may not be displayed correctly at the moment
2. When clicking `Run In Terminal`, a test command will be generated in the terminal
3. When clicking `Debug`, the test(s) will be executed with VS Code debugger enabled (requires the [`debug`](https://github.com/ruby/debug) gem)
- [Learn how to set breakpoints in VS Code](https://code.visualstudio.com/docs/editor/debugging#_breakpoints)

<img src="misc/code-lens.gif" alt="CodeLens" width="75%">

### Document Symbols

Document Symbols can be triggered by:

- Typing `@` in VS Code's command palette
- Pressing `Cmd+Shift+O`

<img src="misc/document-symbol.gif" alt="Document Symbols" width="75%">

### Go to definition

In VS Code this feature can be triggered by one of the following methods:

1. When clicking `Run`, the test(s) will be executed via the Test Explorer.
- However, deeply nested tests may not be displayed correctly at the moment.
2. When clicking `Run In Terminal`, a test command will be generated in the terminal.
3. When clicking `Debug`, the test(s) will be executed with VS Code debugger enabled (requires the [`debug`](https://github.com/ruby/debug) gem).
- [Learn how to set breakpoints in VS Code](https://code.visualstudio.com/docs/editor/debugging#_breakpoints).
- `Right click` on the target, and then select `Go to Definition`
- Placing the cursor on the target, and then hit `F12`
- `Command + click` the target

<img src="misc/go-to-definition.gif" alt="Go to definition" width="75%">

## Development

Expand Down
File renamed without changes
File renamed without changes
Binary file added misc/go-to-definition.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading