Skip to content

Commit 18e5157

Browse files
committed
Improve readme
1 parent b590aac commit 18e5157

File tree

1 file changed

+27
-23
lines changed

1 file changed

+27
-23
lines changed

README.md

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ group :development do
1515
end
1616
```
1717

18-
> [!IMPORTANT]
18+
> [!IMPORTANT]
1919
> Make sure the relevant features are [enabled](https://github.com/Shopify/ruby-lsp/tree/main/vscode#enable-or-disable-features) under your VSCode's `rubyLsp.enabledFeatures` setting, such as `codeLens`.
2020
2121
After running `bundle install`, restart Ruby LSP and you should start seeing CodeLens in your RSpec test files.
@@ -57,50 +57,55 @@ In VS Code this feature can be triggered by one of the following methods:
5757
<img src="misc/go-to-definition.gif" alt="Go to definition" width="75%">
5858

5959
### VS Code Configuration
60-
`ruby-lsp-rspec` supports various configuration items exposed via `settings.json` in VS Code.
6160

62-
These configuration options require the `ruby-lsp` VS Code plugin are nested within `rubyLsp.addonSettings`:
61+
`ruby-lsp-rspec` can be configured through VS Code's `settings.json` file.
62+
63+
All configuration options must be nested under the `Ruby LSP RSpec` addon within `rubyLsp.addonSettings`:
64+
6365
```json
6466
{
65-
...
67+
// ...
6668
"rubyLsp.addonSettings": {
6769
"Ruby LSP RSpec": {
68-
// Configuration goes here
70+
// Configuration options go here
6971
}
7072
}
7173
}
7274
```
7375

7476
#### `rspecCommand`
77+
7578
**Description:**
76-
Override the inferred rspec command with a user-specified command
7779

78-
**Default Value**: `nil` (infer rspec command based on presence of a binstub or Gemfile)
80+
Customize the command used to run tests via CodeLens. If not set, the command will be inferred based on the presence of a binstub or Gemfile.
81+
82+
**Default Value**: `nil`
83+
84+
**Example:**
7985

80-
**Example**
8186
```json
8287
{
83-
...
88+
// ...
8489
"rubyLsp.addonSettings": {
8590
"Ruby LSP RSpec": {
86-
"rspecCommand": "rspec -f d",
91+
"rspecCommand": "rspec -f d"
8792
}
8893
}
8994
}
9095
```
9196

9297
#### `debug`
98+
9399
**Description:**
94-
A boolean flag that prints the complete RSpec command to stdout when enabled.
95100

96-
View the output in VS Code's `OUTPUT` panel under `Ruby LSP`.
101+
Enable debug logging. Currently, this only logs the RSpec command used by CodeLens to stderr, which can be viewed in VS Code's `OUTPUT` panel under `Ruby LSP`.
97102

98103
**Default Value**: `false`
99104

100-
**Example**
105+
**Example:**
106+
101107
```json
102108
{
103-
...
104109
"rubyLsp.addonSettings": {
105110
"Ruby LSP RSpec": {
106111
"debug": true
@@ -109,30 +114,29 @@ View the output in VS Code's `OUTPUT` panel under `Ruby LSP`.
109114
}
110115
```
111116

112-
#### Developing on containers
113-
If your project uses containers for development, you should use `Visual Studio Code Dev Containers` extension.
117+
### Container Development
114118

115-
This extension will run Ruby LSP (and thus Ruby LSP RSpec) within the Dev Container, which allows the proper spec paths to be sent to rspec.
119+
When developing in containers, use the official [`Dev Containers`](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension. This ensures Ruby LSP and Ruby LSP RSpec run inside the container, allowing correct spec path resolution.
116120

117-
For more details on using Ruby LSP with containers and setting up the dev continers extension, see [the Ruby LSP documentation](https://github.com/Shopify/ruby-lsp/blob/main/vscode/README.md?tab=readme-ov-file#developing-on-containers).
121+
For detailed container setup instructions, see the [Ruby LSP documentation](https://github.com/Shopify/ruby-lsp/blob/main/vscode/README.md?tab=readme-ov-file#developing-on-containers).
122+
123+
Make sure to configure Ruby LSP to run inside the container by adding it to your `.devcontainer.json`:
118124

119-
Be sure to specify Ruby LSP as an extension that should run _within_ the Dev Container in your `.devcontainer.json`:
120125
```json
121126
{
122127
"name": "my-app",
123-
...
128+
// ...
124129
"customizations": {
125130
"vscode": {
126131
"extensions": [
127-
"Shopify.ruby-lsp"
128-
...
132+
"Shopify.ruby-lsp",
133+
// ...
129134
]
130135
}
131136
}
132137
}
133138
```
134139

135-
136140
## Development
137141

138142
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

0 commit comments

Comments
 (0)