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

Errors in the EditorParser when using steps with optional groups and not specifying them in features in VS2019 #134

Open
9 of 32 tasks
Ivan-Puchkov opened this issue Sep 16, 2019 · 3 comments

Comments

@Ivan-Puchkov
Copy link

SpecFlow Version:

  • 3.0
  • 2.4
  • 2.3
  • 2.2
  • 2.1
  • 2.0
  • 1.9

Used Test Runner

  • SpecFlow+Runner
  • MSTest
  • NUnit
  • Xunit

Version number:

Project Format of the SpecFlow project

  • Classic project format using packages.config
  • Classic project format using <PackageReference> tags
  • Sdk-style project format

.feature.cs files are generated using

  • SpecFlow.Tools.MsBuild.Generation NuGet package
  • SpecFlowSingleFileGenerator custom tool

Visual Studio Version

  • VS 2019
  • VS 2017
  • VS 2015

Enable SpecFlowSingleFileGenerator Custom Tool option in Visual Studio extension settings

  • Enabled
  • Disabled

Are the latest Visual Studio updates installed?

  • 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
  • .NET Core 2.2
  • .NET Core 3.0

Test Execution Method:

  • 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

SpecflowSampleProject.zip

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.

@SabotageAndi
Copy link
Contributor

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.

@Ivan-Puchkov
Copy link
Author

Ivan-Puchkov commented Sep 18, 2019

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!

@astef
Copy link

astef commented Jan 9, 2020

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

@SabotageAndi SabotageAndi transferred this issue from SpecFlowOSS/SpecFlow Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants