diff --git a/src/PowerShellEditorServices.Host/CodeLens/PesterCodeLensProvider.cs b/src/PowerShellEditorServices.Host/CodeLens/PesterCodeLensProvider.cs index 619ca0a49..e814918ab 100644 --- a/src/PowerShellEditorServices.Host/CodeLens/PesterCodeLensProvider.cs +++ b/src/PowerShellEditorServices.Host/CodeLens/PesterCodeLensProvider.cs @@ -41,9 +41,7 @@ public PesterCodeLensProvider(EditorSession editorSession) /// The Pester symbol to get CodeLenses for. /// The script file the Pester symbol comes from. /// All CodeLenses for the given Pester symbol. - private CodeLens[] GetPesterLens( - PesterSymbolReference pesterSymbol, - ScriptFile scriptFile) + private CodeLens[] GetPesterLens(PesterSymbolReference pesterSymbol, ScriptFile scriptFile) { var codeLensResults = new CodeLens[] { @@ -54,7 +52,11 @@ private CodeLens[] GetPesterLens( new ClientCommand( "PowerShell.RunPesterTests", "Run tests", - new object[] { scriptFile.ClientFilePath, false /* No debug */, pesterSymbol.TestName })), + new object[] { + scriptFile.ClientFilePath, + false /* No debug */, + pesterSymbol.TestName, + pesterSymbol.ScriptRegion?.StartLineNumber })), new CodeLens( this, @@ -63,7 +65,11 @@ private CodeLens[] GetPesterLens( new ClientCommand( "PowerShell.RunPesterTests", "Debug tests", - new object[] { scriptFile.ClientFilePath, true /* Run in debugger */, pesterSymbol.TestName })), + new object[] { + scriptFile.ClientFilePath, + true /* Run in the debugger */, + pesterSymbol.TestName, + pesterSymbol.ScriptRegion?.StartLineNumber })), }; return codeLensResults; @@ -99,9 +105,7 @@ public CodeLens[] ProvideCodeLenses(ScriptFile scriptFile) /// The code lens to resolve. /// /// The given CodeLens, wrapped in a task. - public Task ResolveCodeLensAsync( - CodeLens codeLens, - CancellationToken cancellationToken) + public Task ResolveCodeLensAsync(CodeLens codeLens, CancellationToken cancellationToken) { // This provider has no specific behavior for // resolving CodeLenses.