Errors in the EditorParser when using steps with optional groups and not specifying them in features in VS2019
SpecFlow Version:
- [x] 3.0
- [ ] 2.4
- [ ] 2.3
- [ ] 2.2
- [ ] 2.1
- [ ] 2.0
- [ ] 1.9
Used Test Runner
- [ ] SpecFlow+Runner
- [ ] MSTest
- [ ] NUnit
- [x] Xunit
Version number:
Project Format of the SpecFlow project
- [ ] Classic project format using
packages.config - [ ] Classic project format using
<PackageReference>tags - [x] Sdk-style project format
.feature.cs files are generated using
- [x]
SpecFlow.Tools.MsBuild.GenerationNuGet package - [ ]
SpecFlowSingleFileGeneratorcustom tool
Visual Studio Version
- [x] VS 2019
- [ ] VS 2017
- [ ] VS 2015
Enable SpecFlowSingleFileGenerator Custom Tool option in Visual Studio extension settings
- [ ] Enabled
- [x] Disabled
Are the latest Visual Studio updates installed?
- [x] Yes
- [ ] No, I use Visual Studio version
<Major>.<Minor>.<Patch>
.NET Framework:
- [ ] >= .NET 4.5
- [ ] before .NET 4.5
- [ ] .NET Core 2.0
- [ ] .NET Core 2.1
- [x] .NET Core 2.2
- [ ] .NET Core 3.0
Test Execution Method:
- [x] Visual Studio Test Explorer
- [ ] TFS/VSTS/Azure DevOps – Task – PLEASE SPECIFY THE NAME OF THE TASK
- [ ] Command line – PLEASE SPECIFY THE FULL COMMAND LINE
<SpecFlow> Section in app.config or content of specflow.json
Repro Project
Issue Description
When I use steps with optional groups and without specifying them in my features in VS2019 I get EditorParser errors in Specflow output: [12:36:52.0959008] EditorParser: Start full parsing [12:36:52.0968936] EditorParser: Finished full parsing in 1 ms, 6 errors
Having many steps in the Feature files live parsing is disabled for steps below lower part of the editor: every step has white font, autocomplete is disabled, etc. Adding any character to the line with white font makes the next few lines highlighted again until you reopen the feature file.
Steps to Reproduce
Create a few steps in Binding file with optional groups. In your feature file use these steps but do not include optional group. Add enough steps in the feature file so that scroll bar appear for the file, scroll to the bottom of the file. If the issue doesn't reproduce at first, reopen the feature file.
It could be that we don't support all regex features in the syntax highlighting.
Except from that, optional parameters on bindings are not working at all. So I would suggest you create two separate bindings.
Hello, @SabotageAndi , thank you for your answer! The binding itself works fine for me with optional params (so the correct steps are called and with correct arguments) and the steps are even highlighted correctly at the beginning of my file (I've tried that on the latest version of VS and Extension). And I have no issues and no errors using the older version of the VS Extension and VS2017. It looks like things broke down in release v2019.0.18, since in v2017.2.7 I have no errors and highlighting and navigation to steps works fine using the sample project I've provided in the description.
Thanks!
We're facing the same problem. Syntax highlighting is working fine, until I see "EditorParser: Finished full parsing in 6 ms, 6 errors" line appearing in the Output. After that, highlighting stops working (disappears) after ~30 line of feature file.
It would be great to have a way to diagnose these "6 errors"
It may also be the same issue as https://github.com/techtalk/SpecFlow/issues/1573