Skip to content

Commit

Permalink
Offer language updates of Gherkin v29 in the editor (updated from Ghe…
Browse files Browse the repository at this point in the history
…rkin v22) (#33) (#34)
  • Loading branch information
gasparnagy authored Aug 29, 2024
1 parent 26c84bb commit e221b18
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# [vNext]
* Fix: GH28: Define Steps produces incorrect regex for step definition

## Improvements:

* Find Unused Step Definitions Command: Improved handling of Step Definitions decorated with the 'StepDefinition' attribute. If a Step Definition is used in any Given/Then/When step in a Feature file, the step will no longer show in the 'Find Unused Step Definitions' context menu. (#24)
* Detect existence of SpecFlow for Visual Studio extension and show a warning (#16)
* Extend searched config file locations to match the locations searched for the reqnroll runtime
* Extend searched config file locations to match the locations searched for the reqnroll runtime (#31)
* Offer language updates of Gherkin v29 in the editor (updated from Gherkin v22) (#33)

## Bug fixes:

* Fix: Using the extension side-by-side with the SpecFlow for Visual Studio extension causes CompositionFailedException (#25)
* Fix: Define Steps produces incorrect regex for step definition (#28)

*Contributors of this release (in alphabetical order):* @clrudolphi, @gasparnagy, @jdb0123, @UL-ChrisGlew

Expand Down
3 changes: 2 additions & 1 deletion Reqnroll.VisualStudio.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ID/@EntryIndexedValue">ID</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Deveroom/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Deveroom/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Reqnroll/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ private static StepKeyword GetStepKeyword(GherkinDialect dialect, string stepKey
return StepKeyword.And;
}

protected override Step CreateStep(Location location, string keyword, string text, StepArgument argument,
protected override Step CreateStep(Location location, string keyword, StepKeywordType keywordType, string text, StepArgument argument,
AstNode node)
{
var token = node.GetToken(TokenType.StepLine);
var stepKeyword = GetStepKeyword(token.MatchedGherkinDialect, keyword);
_scenarioBlock = stepKeyword.ToScenarioBlock() ?? _scenarioBlock;

return new DeveroomGherkinStep(location, keyword, text, argument, stepKeyword, _scenarioBlock);
return new DeveroomGherkinStep(location, keyword, keywordType, text, argument, stepKeyword, _scenarioBlock);
}

private void ResetBlock()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ namespace Reqnroll.VisualStudio.Editor.Services.Parser;

public class DeveroomGherkinStep : Step
{
public DeveroomGherkinStep(Location location, string keyword, string text, StepArgument argument,
StepKeyword stepKeyword, ScenarioBlock scenarioBlock) : base(location, keyword, text, argument)
public DeveroomGherkinStep(Location location, string keyword, StepKeywordType keywordType, string text, StepArgument argument,
StepKeyword stepKeyword, ScenarioBlock scenarioBlock) : base(location, keyword, keywordType, text, argument)
{
StepKeyword = stepKeyword;
ScenarioBlock = scenarioBlock;
Expand Down
2 changes: 1 addition & 1 deletion Reqnroll.VisualStudio/Reqnroll.VisualStudio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Gherkin" Version="22.0.0" />
<PackageReference Include="Gherkin" Version="29.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" />
<PackageReference Include="Microsoft.VisualStudio.LanguageServices" Version="4.0.1" />
<PackageReference Include="Nerdbank.Streams" Version="2.8.50" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#nullable disable
using Gherkin;

namespace Reqnroll.VisualStudio.Tests.Discovery;

public abstract class ProjectBindingRegistryTestsBase
Expand All @@ -14,7 +16,7 @@ protected ProjectBindingRegistry CreateSut()
}

protected Step CreateStep(StepKeyword stepKeyword = StepKeyword.Given, string text = "my step",
StepArgument stepArgument = null) => new DeveroomGherkinStep(null, stepKeyword + " ", text, stepArgument,
StepArgument stepArgument = null) => new DeveroomGherkinStep(null, stepKeyword + " ", StepKeywordType.Context, text, stepArgument,
stepKeyword, (ScenarioBlock) stepKeyword);

protected ProjectStepDefinitionBinding CreateStepDefinitionBinding(string regex,
Expand Down

0 comments on commit e221b18

Please sign in to comment.