@@ -28,12 +28,14 @@ class OmniSharpCodeLens extends vscode.CodeLens {
2828export default class OmniSharpCodeLensProvider extends AbstractProvider implements vscode . CodeLensProvider {
2929
3030 private _testManager : TestManager ;
31+ private _options : Options ;
3132
3233 constructor ( server : OmniSharpServer , reporter : TelemetryReporter , testManager : TestManager )
3334 {
3435 super ( server , reporter ) ;
3536
3637 this . _testManager = testManager ;
38+ this . _options = Options . Read ( ) ;
3739 }
3840
3941 private static filteredSymbolNames : { [ name : string ] : boolean } = {
@@ -44,8 +46,7 @@ export default class OmniSharpCodeLensProvider extends AbstractProvider implemen
4446 } ;
4547
4648 provideCodeLenses ( document : vscode . TextDocument , token : vscode . CancellationToken ) : vscode . CodeLens [ ] | Thenable < vscode . CodeLens [ ] > {
47- const options = Options . Read ( ) ;
48- if ( ! options . showReferencesCodeLens )
49+ if ( ! this . _options . showReferencesCodeLens && ! this . _options . showTestsCodeLens )
4950 {
5051 return [ ] ;
5152 }
@@ -64,13 +65,17 @@ export default class OmniSharpCodeLensProvider extends AbstractProvider implemen
6465 }
6566
6667 let lens = new OmniSharpCodeLens ( fileName , toRange ( node . Location ) ) ;
67- bucket . push ( lens ) ;
68+ if ( this . _options . showReferencesCodeLens ) {
69+ bucket . push ( lens ) ;
70+ }
6871
6972 for ( let child of node . ChildNodes ) {
7073 this . _convertQuickFix ( bucket , fileName , child ) ;
7174 }
7275
73- this . _updateCodeLensForTest ( bucket , fileName , node ) ;
76+ if ( this . _options . showTestsCodeLens ) {
77+ this . _updateCodeLensForTest ( bucket , fileName , node ) ;
78+ }
7479 }
7580
7681 resolveCodeLens ( codeLens : vscode . CodeLens , token : vscode . CancellationToken ) : Thenable < vscode . CodeLens > {
0 commit comments