-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is there a way to go to step definition directly from feature file? #99
Comments
No, there is no such way by using I will keep this issue open to see if somebody has a suggestion on how to do that. |
Thank you for super fast answer, looking forward for any suggestions |
I've been looking at issues around this, I've been trying to create some Rosyln Analysers for things like feature files missing/not matching the FeatureFile attribute, to give us red squiggles in the code. The issue is that the content files are not included in the roslyn syntax tree so I can't load them to do the checks. My thought at the moment is that we could somehow cause a parsed set of feature files to be added to Roslyn's syntax tree at compile time, which we could then access through an Analyser. I'm not sure this is even possible yet, but if I can close that loop then it'll be a simple to add warnings/code fixes when a feature file doesn't match the implementing c# - you'd see warnings in your build result. I know even this doesn't add the click-through from the feature file itself (I don't think that will be possible without adding a full extension) but it would definitely tighten up that link between text and code. This is the creating Analyzer stuff from M$ I've been referring to. So far the only useful one I've created shows a warning if a concrete Feature class doesn't have a FeatureFile attribute but I'm sure we can do better :) |
Related to the last response from @csurfleet: This way, the test results can show you what is missing implementation. |
Using the cucumberautocomplete extension (https://github.com/alexkrechik/VSCucumberAutoComplete) in VS Code actually allows you to goto definition. That extension scans text/source files (not assemblies) for patterns like "Given(...)" and assumes that defines steps with the text "..." in them. Once it has matched a step in the feature file it relates it to the line of the step-definition file (C# code) and allows you to jump to that definition. The extension itself knows nothing about implementation languages - it simply scans source files for Gherkin-like patterns (with all the issues such an over simplification implies). |
Is this the I had a go at populating them but was having trouble attaching a debugger to work out the correct values. |
I tried those properties a long time ago (I can't remember all the details), but they did not work. So currently, I don't have a way to make that work. If you figure it out, you're welcome to report back or submit a PR. |
is there a way to go to step definition directly from feature file?
Like by pressing F12
The text was updated successfully, but these errors were encountered: