@@ -41,6 +41,7 @@ abstract class TestCodeLens extends OmniSharpCodeLens {
4141 constructor (
4242 range : protocol . V2 . Range ,
4343 fileName : string ,
44+ public displayName : string ,
4445 public isTestContainer : boolean ,
4546 public testFramework : string ,
4647 public testMethodNames : string [ ] ) {
@@ -53,23 +54,25 @@ class RunTestsCodeLens extends TestCodeLens {
5354 constructor (
5455 range : protocol . V2 . Range ,
5556 fileName : string ,
57+ displayName : string ,
5658 isTestContainer : boolean ,
5759 testFramework : string ,
5860 testMethodNames : string [ ] ) {
5961
60- super ( range , fileName , isTestContainer , testFramework , testMethodNames ) ;
62+ super ( range , fileName , displayName , isTestContainer , testFramework , testMethodNames ) ;
6163 }
6264}
6365
6466class DebugTestsCodeLens extends TestCodeLens {
6567 constructor (
6668 range : protocol . V2 . Range ,
6769 fileName : string ,
70+ displayName : string ,
6871 isTestContainer : boolean ,
6972 testFramework : string ,
7073 testMethodNames : string [ ] ) {
7174
72- super ( range , fileName , isTestContainer , testFramework , testMethodNames ) ;
75+ super ( range , fileName , displayName , isTestContainer , testFramework , testMethodNames ) ;
7376 }
7477}
7578
@@ -152,7 +155,7 @@ export default class OmniSharpCodeLensProvider extends AbstractProvider implemen
152155 codeLens . command = {
153156 title : pluralTitle ,
154157 command : pluralCommandName ,
155- arguments : [ codeLens . testMethodNames , codeLens . fileName , codeLens . testFramework ]
158+ arguments : [ codeLens . displayName , codeLens . testMethodNames , codeLens . fileName , codeLens . testFramework ]
156159 } ;
157160 }
158161
@@ -188,8 +191,8 @@ function createCodeLensesForElement(element: Structure.CodeElement, fileName: st
188191 let range = element . Ranges [ SymbolRangeNames . Name ] ;
189192
190193 if ( range && testFramework && testMethodName ) {
191- results . push ( new RunTestsCodeLens ( range , fileName , /*isTestContainer*/ false , testFramework , [ testMethodName ] ) ) ;
192- results . push ( new DebugTestsCodeLens ( range , fileName , /*isTestContainer*/ false , testFramework , [ testMethodName ] ) ) ;
194+ results . push ( new RunTestsCodeLens ( range , fileName , element . DisplayName , /*isTestContainer*/ false , testFramework , [ testMethodName ] ) ) ;
195+ results . push ( new DebugTestsCodeLens ( range , fileName , element . DisplayName , /*isTestContainer*/ false , testFramework , [ testMethodName ] ) ) ;
193196 }
194197 }
195198 else if ( isValidClassForTestCodeLens ( element ) ) {
@@ -210,8 +213,8 @@ function createCodeLensesForElement(element: Structure.CodeElement, fileName: st
210213 }
211214 }
212215
213- results . push ( new RunTestsCodeLens ( range , fileName , /*isTestContainer*/ true , testFramework , testMethodNames ) ) ;
214- results . push ( new DebugTestsCodeLens ( range , fileName , /*isTestContainer*/ true , testFramework , testMethodNames ) ) ;
216+ results . push ( new RunTestsCodeLens ( range , fileName , element . DisplayName , /*isTestContainer*/ true , testFramework , testMethodNames ) ) ;
217+ results . push ( new DebugTestsCodeLens ( range , fileName , element . DisplayName , /*isTestContainer*/ true , testFramework , testMethodNames ) ) ;
215218 }
216219 }
217220
0 commit comments