cucumber / language-service

Cucumber Language Service
MIT License
18 stars 27 forks source link

fix: godog step definitions within method declarations #215

Closed tigh-latte closed 4 months ago

tigh-latte commented 5 months ago

🤔 What's changed?

Add treesitter queries for finding godog steps within methods.

⚡️ What's your motivation?

We currently load up our godog steps from a method with variable attributes attached, so the language service isn't finding them.

So, while this currently works:

func Steps(sc *godog.ScenarioContext) {
    sc.Given(`^I test this change$`, handler)
}

This doesn't:

func (s suite) Steps(sc *godog.ScenarioContext) {
    sc.Given(`^I test this change$`, s.handler)
}

🏷️ What kind of change is this?

♻️ Anything particular you want feedback on?

Nope it's all good.

📋 Checklist:


This text was originally generated from a template, then edited by hand. You can modify the template here.

tigh-latte commented 4 months ago

Fadhb ar bith a chara