Closed onthespotqa closed 1 year ago
I'm encountering this, too!
Partial support for template literals (I fill:
) would be trivial to add. However, string interpolation cannot be supported (I ${something}
).
This library parses the source code (using the tree-sitter library) to extract the step definition expressions, but it doesnβt execute or interpret the source code, which would be necessary in order to evaluate string interpolation.
We could recognise template literals without interpolation and process those, and ignore template literals with interpolation.
Are you relying on interpolation at all? And if not, why are you using template literals and not simple single/double quoted strings?
Good question! In my project, I'm using template literals because my steps frequently use both '
(in the grammatical genitive/possessive sense and "
(to quote multi-word parameters). The backtick is a handy way avoid escaping one or the other. I don't use substitution in my template literals, and naturally I wouldn't expect Cucumber to help if I were to.
Your proposal to handle substitution-free literals would work ideally for me. Trying to account for them would probably just cause confusion.
P.S. thank you for providing an official VS Code plugin; both gherkin/cucumber and Code have become instrumental to my workflow.
@xeger @onthespotqa the #107 fix is released in Cucumber VSCode 1.5.0. I thought it was fine, but I'm still not seeing step definitions defined with template literals working, so I might have to reopen this. Or you could reopen this if it's not working for you either.
Confirmed that it's not working for me, either, with 1.5.0. π€ I will review your PR and see if there's an obvious reason.
I lack permission to reopen this issue; will open a new one if I have anything useful to contribute in the way of troubleshooting details.
I just pushed 1.5.1 where I believe it's fixed. The fix was 001e34f4014499b6ec6a30c529269f1515eec348.
Now did I earn some βββββ at the marketplace? π₯Ί
You've earned a lot more than that, my friend, with all of the excellent tooling you've given me over the years!
confirmed its fixed. thanks for the quick turnaround.
π What did you see?
Extension does not recognize steps that use backticks instead of quotes.
β What did you expect to see?
I would expect the extension to recognize steps that use backticks.
π¬ How could we reproduce it?
In a step file create a step that uses backticks