cucumber / cucumber/vscode

Can't find Ruby step definitions when using Turnip: it defines with `step`, not `Given` or `When` etc.

Open
#317 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
88
Forks
33
PR merge metrics
No merged PRs in 30d

Description

### 👓 What did you see?

Undefined step, when the step is defined and the tests run just fine:
Image
```rb
module FeatureSteps
step "I am logged in" do
login(@user)
end
# ...
end
```

### ✅ What did you expect to see?

Step definition is found by the language service:
Image

### 📦 Which tool/library version are you using?

ruby 3.4.7
turnip 4.4.1 (latest)
Cucumber extension 1.11.0 (latest)
```
# Gemfile.lock
cucumber-gherkin (32.1.2)
cucumber-messages (> 25, < 28)
cucumber-messages (27.2.0)
cuke_modeler (3.24.0)
cucumber-gherkin (< 33.0)
rspec (3.13.1)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
turnip (4.4.1)
cuke_modeler (~> 3.15)
rspec (>= 3.0, < 4.0)
```

### 🔬 How could we reproduce it?

1. setup a base Ruby repo, with bundler
2. `bundle add turnip`
3. setup rspec + turnip:
```
$ bundle exec rspec --init
$ echo '--require turnip/rspec' >> .rspec
$ echo '--require steps' >> .rspec
$ cat <<'EOF' > spec/steps.rb
RSpec.configure { |config| config.include(FeatureSteps, type: :feature) }
module FeatureSteps
step "I am logged in" do
puts "TODO: log in"
end
end
EOF
```
4. make a feature file:
```
$ cat <<'EOF' > spec/features/example.feature
Feature: example

Scenario: logged in
Given I am logged in
EOF
```
5. configure Cucumber VS Code extension:
```json
"cucumber.features": [
"spec/**/*.feature",
"features/**/*.feature",
],
"cucumber.glue": [
"*spec/support/*.rb",
"*features/**/*.rb",
]
```
6. view the feature file in VS Code: `code spec/features/example.feature`

### 📚 Any additional context?

Fixed (hopefully) in https://github.com/cucumber/language-service/pull/297, similar to #233

Thanks in advance ☺️
Henry

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.