Skip to content
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

Install instructions and how "Create Step" works #6

Closed
Andras-Csanyi opened this issue Jan 30, 2021 · 14 comments
Closed

Install instructions and how "Create Step" works #6

Andras-Csanyi opened this issue Jan 30, 2021 · 14 comments

Comments

@Andras-Csanyi
Copy link

Hi,

Thanks for creating this plugin. Honestly, being able to navigate between scenarios and step definitions is a great promise. Right now it is a huge PITA.

It is not clear how to install and start using this plugin. Rider comes with Gherkin and Cucumber plugins bundled and enabled. So, kind of one can progress with Rider. If I install this plugin then I'll get a conflict message and RIder says I have to disable either Gherkin or Specflow support. But, the fact is that both is needed to have the syntax highlight and the services your plugin provides. (Or it is not clear what is the right setup) I'm sure I'm not going to be only one being puzzled here.

The other is how "Create Step" works? When I open a feature file it offers "Create step" but no instructions what can happen.

Any chance this plugin can discover connections between already existing feature files and StepDefinitions?

Again, thanks for your work!

@mickvikt
Copy link

I'll second to this: it is a bit unclear

@Socolin
Copy link
Collaborator

Socolin commented Jan 31, 2021

It is not clear how to install and start using this plugin. Rider comes with Gherkin and Cucumber plugins bundled and enabled. So, kind of one can progress with Rider. If I install this plugin then I'll get a conflict message and RIder says I have to disable either Gherkin or Specflow support. But, the fact is that both is needed to have the syntax highlight and the services your plugin provides. (Or it is not clear what is the right setup) I'm sure I'm not going to be only one being puzzled here.

So the Cucumber and Gherkin plugins that come with Rider are written for the Java part of Rider (it come with IntelliJ idea).
From my understanding, to fix the problem of multiple libraries using the same language/file extensions they split this into 2 plugins Gherkin for the language, syntax highlight, etc... and CucumberJs for all the things related to the javascript library.

The problem comes from the fact that SpecFlow needs to interact with C# code (and maybe F# ?) and to do this the parser/lexer and highlighting of gherkin needed to be written in the Reshaper part of the plugin.

At this point, I get a conflict that I did not found how to resolve yet: Which plugin is responsible for handling .feature files.

I'll try to dig into it to find a way to detect the project style in which the .feature is and force one or another.

That's why for now there is a popup at startup that ask to disable Gherkin / CucumberJS plugin.

The other is how "Create Step" works? When I open a feature file it offers "Create step" but no instructions what can happen.

Could you share me a project sample so I can reproduce ? "Create Step" should provide you with a list of class tagged with [Binding] in which you could add the step. Maybe I should also provide an options to create a new class too ?

Any chance this plugin can discover connections between already existing feature files and StepDefinitions?

It should be automatic, again, a sample of code could help me found what is the problem. Do you use the Regular expressions in attributes rules ? other one are not yet supported, I plan to add them soon.

Again, thanks for your work!

Thanks for the feedback

@Andras-Csanyi
Copy link
Author

This is the repo I'm working on. The src/MasterData/MasterData.BusinessLogic.Features and src/MasterData/MasterData.Web.Api.Features already have a few .feature files. When I start Rider with Specflow support plugin enabled and open this solution the plugin doesn't see the stepdefinition files.

@Socolin
Copy link
Collaborator

Socolin commented Feb 1, 2021

Ok I've found the problem, can you test this version https://github.com/Socolin/resharper-specflow/actions/runs/527924166 (once the build is completed, see the artifacts at the end, see this on how to manually install the plugin)

@Andras-Csanyi
Copy link
Author

Ok, later I'll take a look at it and let you know.

@Socolin
Copy link
Collaborator

Socolin commented Feb 1, 2021

I forgot to mention, you should be able to re enable Gherkin and Cucumber JS too

@Andras-Csanyi
Copy link
Author

The result is that there is no syntax highlight for *.feature files when the plugin is installed. It doesn't matter whether the Gherkin and Cucumber plugin is enabled or disabled. I saw that you introduced the Specflow file type.

I tried the following combinations:

  • Gherkin enabled with Specflow plugin enabled -> no syntax highlight and functionalities the plugin promises
  • Gherkin disabled with Specflow plugin enabled -> no syntax highlight and functionalities the plugin promises
  • Invalidate cache with the two combo aboce and the result is the same
  • Reinstall RIder and the result is the same as above

I reiterated the combinations above with the plugin you suggested above, and the newly published one at Jetbrains side.

It seems I'm extremely clumsy today.

@Socolin
Copy link
Collaborator

Socolin commented Feb 1, 2021

Hum, I'm confused so you don't have the highlighting at all ?
I'm able to open the project you linked with everything working
Peek 2021-02-01 16-54

That's strange... The version 1.2.3 should have fixed all the problem I've seen in your project.

What OS do you use ?
Do you have any error (red icon blinkin in the rider status bar) ?
Are you using Rider 2020.3.2 ?
Is the solution analysis enabled ?

Next step if this does not fix, you can clone this project, and run it, then attach to the dotnet process and put a breakpoint in SpecflowStepsDefinitionsCache.Build and check that the line
stepDefinitions.Add(BuildBindingClassCacheEntry(classDeclaration)); is called

@Andras-Csanyi
Copy link
Author

I'll give it a try again. Yup, there is no sytax highlight at all.
MacOS, latest stable Rider.
Solution analysis is disabled.

I'll check it later today.

@Andras-Csanyi
Copy link
Author

Andras-Csanyi commented Feb 2, 2021

You are not gonna believe it what was the problem. But it shows a valid usecase too.
I use Resharper.Dark color scheme which is not part of Rider default set color schemes, and the plugin syntax highlight works, it seems, only with the bundled/default set of schemes.

Can I suggest that if the color scheme is not the official then the plugins' syntax highlight falls back to a selectable default color scheme? I personally don't like Riders default stuff. I got used to Resharper in VS and I like it. Right now the plugin works Click on Given/When/Then takes me to the StepDefinition, but no syntax highlight.

@Socolin
Copy link
Collaborator

Socolin commented Feb 2, 2021

Ok, just to be sure, all other problems are fixed except for the color scheme ?

I'll take a look on how the theme is working to see if there is a solution :)

@Socolin
Copy link
Collaborator

Socolin commented Feb 3, 2021

So I took a look woth the Resharper Dark them and for some reason colors are not define but they do not fallback to the them standard things

image

It's doing this for other theme

image

So I suspect there is a problem with this theme. I'm going to ask about this. For now you can check the checkbox on each line and you should be good.

@Andras-Csanyi
Copy link
Author

Ok, just to be sure, all other problems are fixed except for the color scheme ?

I can create Steps, however I found an inconvience, but I'll report it in a separate issue because this issue is a mess now.

Is file formatting and intellisense provided by this plugin? If yes, they still don't work.

I'll take a look on how the theme is working to see if there is a solution :)

Thank you and sorry for being a pain. :)

@Socolin
Copy link
Collaborator

Socolin commented Feb 3, 2021

About theme issue, I reported the problem to jetbrains and it seems there is a strange bug, so it seems to be on their side.
I'm going to close this issue.

Is file formatting and intellisense provided by this plugin? If yes, they still don't work.

I plan for those soon, You can subsribe to those issues
#9
#10

I'll take a look on how the theme is working to see if there is a solution :)

Thank you and sorry for being a pain. :)

No problem :)

@Socolin Socolin closed this as completed Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants