diff --git a/CHANGELOG.md b/CHANGELOG.md index d973b927..c566c6b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] ### Fixed - (Ruby) Support `And` and `But` step definition annotations ([#211](https://github.com/cucumber/language-service/pull/211)) +- (Python) Title variants of Behave's decorators (`Step`, `Given`, `When`, `Then`) ([#213](https://github.com/cucumber/language-service/pull/213)) ## [1.6.0] - 2024-05-12 ### Added diff --git a/src/language/pythonLanguage.ts b/src/language/pythonLanguage.ts index 676250f9..88bf1685 100644 --- a/src/language/pythonLanguage.ts +++ b/src/language/pythonLanguage.ts @@ -98,7 +98,7 @@ export const pythonLanguage: Language = { arguments: (argument_list (string) @expression) ) ) - (#match? @method "(given|when|then|step)") + (#match? @method "(given|when|then|step|Given|When|Then|Step)") ) @root`, ], snippetParameters: { diff --git a/test/language/testdata/python/StepDefinitions.py b/test/language/testdata/python/StepDefinitions.py index cc61457f..d772f217 100644 --- a/test/language/testdata/python/StepDefinitions.py +++ b/test/language/testdata/python/StepDefinitions.py @@ -23,13 +23,13 @@ def step_undef(context, planet): assert planet -@given("/^a regexp$/") +@Step("/^a regexp$/") def step_re(context, expression): """Test Re.""" assert expression -@given("the bee's knees") +@Given("the bee's knees") def step_bees(context, expression): """Test Re.""" assert expression