private void PerformJump(StepDefinitionUsage usage) { var sourceLocation = usage.SourceLocation; if (sourceLocation == null) { Logger.LogWarning($"Cannot jump to {usage}: no source location"); IdeScope.Actions.ShowProblem("Unable to jump to the step. No source location detected."); return; } Logger.LogInfo($"Jumping to {usage} at {sourceLocation}"); if (!IdeScope.Actions.NavigateTo(sourceLocation)) { Logger.LogWarning($"Cannot jump to {usage}: invalid source file or position"); IdeScope.Actions.ShowProblem($"Unable to jump to the step. Invalid source file or file position.{Environment.NewLine}{sourceLocation}"); } }
private string GetUsageLabel(StepDefinitionUsage usage) { return($"{usage.Step.Keyword}{usage.Step.Text}"); }
private ContextMenuItem CreateMenuItem(StepDefinitionUsage usage, IProjectScope project) { return(new SourceLocationContextMenuItem( usage.SourceLocation, project.ProjectFolder, GetUsageLabel(usage), _ => { PerformJump(usage); }, GetIcon())); }