You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-23Lines changed: 27 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ group :development do
15
15
end
16
16
```
17
17
18
-
> [!IMPORTANT]
18
+
> [!IMPORTANT]
19
19
> 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`.
20
20
21
21
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:
57
57
<imgsrc="misc/go-to-definition.gif"alt="Go to definition"width="75%">
58
58
59
59
### VS Code Configuration
60
-
`ruby-lsp-rspec` supports various configuration items exposed via `settings.json` in VS Code.
61
60
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
+
63
65
```json
64
66
{
65
-
...
67
+
// ...
66
68
"rubyLsp.addonSettings": {
67
69
"Ruby LSP RSpec": {
68
-
// Configuration goes here
70
+
// Configuration options go here
69
71
}
70
72
}
71
73
}
72
74
```
73
75
74
76
#### `rspecCommand`
77
+
75
78
**Description:**
76
-
Override the inferred rspec command with a user-specified command
77
79
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:**
79
85
80
-
**Example**
81
86
```json
82
87
{
83
-
...
88
+
// ...
84
89
"rubyLsp.addonSettings": {
85
90
"Ruby LSP RSpec": {
86
-
"rspecCommand": "rspec -f d",
91
+
"rspecCommand": "rspec -f d"
87
92
}
88
93
}
89
94
}
90
95
```
91
96
92
97
#### `debug`
98
+
93
99
**Description:**
94
-
A boolean flag that prints the complete RSpec command to stdout when enabled.
95
100
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`.
97
102
98
103
**Default Value**: `false`
99
104
100
-
**Example**
105
+
**Example:**
106
+
101
107
```json
102
108
{
103
-
...
104
109
"rubyLsp.addonSettings": {
105
110
"Ruby LSP RSpec": {
106
111
"debug": true
@@ -109,30 +114,29 @@ View the output in VS Code's `OUTPUT` panel under `Ruby LSP`.
109
114
}
110
115
```
111
116
112
-
#### Developing on containers
113
-
If your project uses containers for development, you should use `Visual Studio Code Dev Containers` extension.
117
+
### Container Development
114
118
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.
116
120
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`:
118
124
119
-
Be sure to specify Ruby LSP as an extension that should run _within_ the Dev Container in your `.devcontainer.json`:
120
125
```json
121
126
{
122
127
"name": "my-app",
123
-
...
128
+
// ...
124
129
"customizations": {
125
130
"vscode": {
126
131
"extensions": [
127
-
"Shopify.ruby-lsp"
128
-
...
132
+
"Shopify.ruby-lsp",
133
+
// ...
129
134
]
130
135
}
131
136
}
132
137
}
133
138
```
134
139
135
-
136
140
## Development
137
141
138
142
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