diff --git a/CHANGELOG.md b/CHANGELOG.md index 077cae03..de7d3f10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,12 +8,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] ### Fixed - (Python) Fix index failures from partial parameter type matches ([#196](https://github.com/cucumber/language-service/pull/196)) +- (Python) Unexpected spaces and commas in generated step definitions ([#160](https://github.com/cucumber/language-service/issues/160)) - (Rust) Support for r# raw strings with step definition patterns ([#176](https://github.com/cucumber/language-service/pull/176)) - (Rust) Line continuation characters in rust step definition patterns ([#179](https://github.com/cucumber/language-service/pull/179)) -- (Python) Unexpected spaces and commas in generated step definitions ([#160](https://github.com/cucumber/language-service/issues/160)) ### Added - (Python) Support for u-strings with step definition patterns ([#173](https://github.com/cucumber/language-service/pull/173)) +- (Python) Support for behave's generic step definition decorator ([#200](https://github.com/cucumber/language-service/pull/200)) - (Go) Support for Godog step definitions ([#130](https://github.com/cucumber/language-service/pull/130)) ## [1.4.1] - 2023-07-16 diff --git a/src/language/pythonLanguage.ts b/src/language/pythonLanguage.ts index 981a2b01..63d40d04 100644 --- a/src/language/pythonLanguage.ts +++ b/src/language/pythonLanguage.ts @@ -106,7 +106,7 @@ export const pythonLanguage: Language = { arguments: (argument_list (string) @expression) ) ) - (#match? @method "(given|when|then)") + (#match? @method "(given|when|then|step)") ) @root `, ], diff --git a/test/language/testdata/python/StepDefinitions.py b/test/language/testdata/python/StepDefinitions.py index a043d9ec..75d66ea8 100644 --- a/test/language/testdata/python/StepDefinitions.py +++ b/test/language/testdata/python/StepDefinitions.py @@ -1,10 +1,8 @@ """Port of givens for testdata.""" -from behave import given -import datetime -import re +from behave import step, given, when, then -@given("a {uuid}") +@step("a {uuid}") def step_given(context, uuid): assert uuid @@ -14,12 +12,12 @@ def step_date(context, date): assert date -@given("a {planet}") +@when("a {planet}") def step_planet(context, planet): assert planet -@given("an {undefined-parameter}") +@then("an {undefined-parameter}") def step_undef(context, planet): assert planet