SpecFlowOSS / SpecFlow.Rider

SpecFlow support for both ReSharper and Rider
MIT License
29 stars 18 forks source link

Specflow 'Go To Declaration or Usage' feature file navigates to the wrong step definition #178

Closed tkapustina closed 10 months ago

tkapustina commented 2 years ago

Initial request: https://youtrack.jetbrains.com/issue/RIDER-78256/Specflow-Go-To-Declaration-or-Usage-feature-file-navigates-to-the-wrong-step-definition

In the feature file we have a step called 'I have an existing document in the Command Api'. And it should navigate to the '[Given(@"I have an existing document (.) in the Command Api")]' step definition, but it leads to '[Given(@"I have an existing document (.)")]'. These both steps have the identical first part of sentence but the different end.In compare with Visual Studio 2022 - there it works well.

Version: 2022.1.1Build: RD-221.5591.20Timezone: Europe/PragueEvaluation: trueEnvironment: RD-221.5591.20, JRE 11.0.14.1 1-b2043.45x64 JetBrains s.r.o., OS Windows 10(amd64) v10.0 , screens 1920.0x1080.0, 1920.0x1080.0.NET Framework 4.0.30319.42000

barisgul commented 1 year ago

Hello, I am facing with the same problem. It works on Visual studio 2022 but doesn't work with Rider 2022.3.1 I think Scope binding is not working properly. Because I have Scope attribute in my step definition class and it implements another class. Here is the example:

1. Scenario: image

2. Scope Binding in GetPersonStepDefinitions.cs image

3. The step I'm expecting to bind in GetPersonStepDefinitions.cs image

4. Actual binding in completely a different class (DuplicationCheckStepDefinitions.cs) image image

Is there any plan to fix it?

Socolin commented 1 year ago

Hello, I am facing with the same problem. It works on Visual studio 2022 but doesn't work with Rider 2022.3.1 I think Scope binding is not working properly. Because I have Scope attribute in my step definition class and it implements another class. Here is the example:

  • OS: Windows
  • Rider version: 2022.3.1
  • Specflow plugin version: 1.15.3

1. Scenario: image

2. Scope Binding in GetPersonStepDefinitions.cs image

3. The step I'm expecting to bind in GetPersonStepDefinitions.cs image

4. Actual binding in completely a different class (DuplicationCheckStepDefinitions.cs) image image

Is there any plan to fix it?

Yes, when I can find some time to do it

Jazzman82 commented 1 year ago

We have the same issue here.

aventus13 commented 1 year ago

I have the same issue. Trying to navigate to a step definition seems to be randomly picking definitions, even though they are supposed to be scoped to another feature. This is especially frustrating when I create a new feature, write up a number of steps, and expect that the IDE will pick up that no matching definitions were found, thus suggesting to create them for me. Unfortunately, it seems to be finding some other scoped steps and considers them to be valid for the new feature.

Socolin commented 1 year ago

This should be fixed in the next version.

Can you check this when it's available (1.21) or by downloading it here https://github.com/SpecFlowOSS/SpecFlow.Rider/actions/runs/7001534208 (Work with latest 2023.3 EAP) and let me know if this fix your issue ?

Jazzman82 commented 10 months ago

This issue is fixed here.