Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ public IReadOnlyList<GherkinDiagnostic> Aggregate(
BindingSource));
}

// Ambiguous matches reported as errors
// Ambiguous matches reported as errors. Result.GetErrorMessage() lists every matching
// binding (MatchResult.CreateMultiMatch builds it for exactly this case), so hovering
// shows which step definitions collide instead of just "it's ambiguous".
foreach (var step in matchSet.Ambiguous)
{
diagnostics.Add(new GherkinDiagnostic(
AmbiguousStepMessage,
step.Result.GetErrorMessage() ?? AmbiguousStepMessage,
step.Range,
GherkinDiagnosticSeverity.Error,
BindingSource));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ public void Ambiguous_step_produces_Error_diagnostic_with_correct_message_and_so
var diag = result[0];
diag.Severity.Should().Be(GherkinDiagnosticSeverity.Error);
diag.Source.Should().Be(DiagnosticsAggregator.BindingSource);
diag.Message.Should().Be("Ambiguous step definition.");
diag.Message.Should().Contain("Method1", "the hover message should list every colliding binding, not just say it's ambiguous");
diag.Message.Should().Contain("Method2");
}

[Fact]
Expand Down
Loading