@@ -12,21 +12,19 @@ public void FormatGherkinDocument(DeveroomGherkinDocument gherkinDocument, Docum
1212 return ;
1313
1414 SetTagsAndLine ( lines , gherkinDocument . Feature , string . Empty ) ;
15- SetLinesForChildren ( lines , gherkinDocument . Feature . Children , formatSettings , formatSettings . FeatureChildrenIndentLevel ) ;
15+ SetLinesForChildren ( lines , gherkinDocument . Feature . Children , formatSettings , formatSettings . FeatureChildrenIndentLevel , gherkinDocument . GherkinDialect ) ;
1616 }
1717
1818 private void SetLinesForChildren ( DocumentLinesEditBuffer lines , IEnumerable < IHasLocation > hasLocation ,
19- GherkinFormatSettings formatSettings , int indentLevel )
19+ GherkinFormatSettings formatSettings , int indentLevel , GherkinDialect gherkinDialect )
2020 {
21- var dialectProvider = ReqnrollGherkinDialectProvider . Get ( formatSettings . Language ) ;
22-
2321 foreach ( var featureChild in hasLocation )
2422 {
2523 SetTagsAndLine ( lines , featureChild , GetIndent ( formatSettings , indentLevel ) ) ;
2624
2725 if ( featureChild is Rule rule )
2826 SetLinesForChildren ( lines , rule . Children , formatSettings ,
29- indentLevel + formatSettings . RuleChildrenIndentLevelWithinRule ) ;
27+ indentLevel + formatSettings . RuleChildrenIndentLevelWithinRule , gherkinDialect ) ;
3028
3129 if ( featureChild is ScenarioOutline scenarioOutline )
3230 foreach ( var example in scenarioOutline . Examples )
@@ -39,12 +37,12 @@ private void SetLinesForChildren(DocumentLinesEditBuffer lines, IEnumerable<IHas
3937 }
4038
4139 if ( featureChild is IHasSteps hasSteps )
42- FormatSteps ( lines , formatSettings , indentLevel , hasSteps , dialectProvider ) ;
40+ FormatSteps ( lines , formatSettings , indentLevel , hasSteps , gherkinDialect ) ;
4341 }
4442 }
4543
4644 private void FormatSteps ( DocumentLinesEditBuffer lines , GherkinFormatSettings formatSettings , int indentLevel ,
47- IHasSteps hasSteps , GherkinDialectProvider dialectProvider )
45+ IHasSteps hasSteps , GherkinDialect gherkinDialect )
4846 {
4947 var previousKeyword = "" ;
5048
@@ -62,7 +60,7 @@ private void FormatSteps(DocumentLinesEditBuffer lines, GherkinFormatSettings fo
6260 {
6361 if ( step . Keyword == previousKeyword )
6462 {
65- var andKeyword = GetAndKeyword ( dialectProvider ) ;
63+ var andKeyword = GetAndKeyword ( gherkinDialect ) ;
6664 newKeyword = $ "{ andKeyword } ";
6765 }
6866 else
@@ -84,9 +82,9 @@ private void FormatSteps(DocumentLinesEditBuffer lines, GherkinFormatSettings fo
8482 }
8583 }
8684
87- private static string GetAndKeyword ( GherkinDialectProvider dialectProvider )
85+ private static string GetAndKeyword ( GherkinDialect gherkinDialect )
8886 {
89- return dialectProvider . DefaultDialect . AndStepKeywords . First ( keyword => keyword != GherkinDialect . AsteriskKeyword ) ;
87+ return gherkinDialect . AndStepKeywords . First ( keyword => keyword != GherkinDialect . AsteriskKeyword ) ;
9088 }
9189
9290 private void SetTagsAndLine ( DocumentLinesEditBuffer lines , IHasLocation hasLocation , string indent )
0 commit comments