SpecFlow.Rider icon indicating copy to clipboard operation
SpecFlow.Rider copied to clipboard

Steps in Linked feature files are showing up as undefined and Plugin Intellisense not working

Open rdasan opened this issue 4 years ago • 11 comments

I am using my feature files as .csproj linked files. I need to to it in this fashion because my feature files are in a separate repo and I include them in the main repo as git subrepo . After that I just include the relevant .feature file as a Linked file in my Test project. However when I do that, the SpecFlow Plugin intellisense like "Go To Reference / Find Usages" does not seem to work. Also the steps show up as undefined even though I have defined and implemented them. This problem does not cause a build or Test issue. I'm using the latest version of the Plugin, .net 5.0 and xUnit testing framework

rdasan avatar Mar 01 '21 07:03 rdasan

Is there a workaround for this that anybody can suggest?

rdasan avatar Mar 04 '21 23:03 rdasan

Hello,

I did not have time to check yet. It would help if you can provide us with a small project to reproduce the bug.

Socolin avatar Mar 04 '21 23:03 Socolin

Hi,

Thanks for responding. I have added a project in my github for your reference... https://github.com/rdasan/LinkedFeatureFile/tree/master/LinkedFeatureFile

The sample.feature file is added as a Linked file in the LinkedFeatureFile project

rdasan avatar Mar 08 '21 07:03 rdasan

@Socolin Was that helpful? The sample project illustrating the issue?

rdasan avatar Mar 09 '21 18:03 rdasan

I'll check this tonight

Socolin avatar Mar 09 '21 19:03 Socolin

Can you verify if this build fix your problem ? https://github.com/SpecFlowOSS/SpecFlow.Rider/runs/2072240670

Socolin avatar Mar 10 '21 01:03 Socolin

@Socolin Apologies for not getting back on this. I did not get a chance to check that build. But I have the latest Release installed now and it's still not working for Linked Files.

rdasan avatar Jun 02 '21 17:06 rdasan

@rdasan Is this working in Visual Studio for you? With SpecFlow 3.0 we dropped support for files that are at another location than under the project. The reason is, that there are some questions, we couldn't answer. Like where to generate the *.feature.cs file for linked files.

SabotageAndi avatar Jun 03 '21 13:06 SabotageAndi

@SabotageAndi I have not tried on Visual Studio. Right now in Rider, when I Link the feature file and set the Build Action as SpecFlowFeatureFiles , the feature.cs file gets generated at the same .../dotnet/test/Features location. Which I'm fine with. But the Linked feature has zero intellisense or any features offered by the SpecFlow Rider Plugin. It just behaves like a plain text file. Screen Shot 2021-06-04 at 1 03 04 PM

rdasan avatar Jun 04 '21 20:06 rdasan

@rdasan Is this working in Visual Studio for you? With SpecFlow 3.0 we dropped support for files that are at another location than under the project. The reason is, that there are some questions, we couldn't answer. Like where to generate the *.feature.cs file for linked files.

Isn't it safe to generate the files to the same location as the original file?

nferrellcmg avatar Jun 04 '21 20:06 nferrellcmg

@nferrellcmg No, it is not. When you link the file in multiple projects you run quickly into problems. At least with the namespace.

SabotageAndi avatar Jul 18 '22 07:07 SabotageAndi