Open DanielSCy opened 1 year ago
Hi @DanielSCy thanks for reporting this. It sounds like we need to handle escapes better in unescapeString
: https://github.com/cucumber/language-service/blob/3bfbad6c7e323bc917f231519b6e78b82b655d88/src/language/javaLanguage.ts#L126
Currently it's only escaping \\
back to \
, but it should handle all Java String escapes.
A test for this should be added to https://github.com/cucumber/language-service/blob/main/test/language/javaLanguage.test.ts
We might take inspiration from https://github.com/iamakulov/unescape-js (I don't want to depend on the library which is unlikely to be maintained).
There are also some more details about this in this SO post
Would you be able to help with a pull request with this @DanielSCy?
👓 What did you see?
I have below step defined in my steps file:
The
\
before"
is required by Java but the language server should only see"
. Also, when I run the tests everything is well, so it's not an issue with the definition of the step or the feature file. However, the language server gives the below exception and the step is not recognized in the feature file:✅ What did you expect to see?
The step definition would be parsed without error.
📦 Which tool/library version are you using?
I am running VSCode with cucumber extension 1,5,1 as seen also in the stack trace.
🔬 How could we reproduce it?
Steps to reproduce the behavior: