@@ -19,20 +19,12 @@ export class BazelrcFeature implements IExtensionFeature, vscode.Disposable {
1919 ) {
2020 }
2121
22- private registerBazelCommandCodeLensProviders ( bazelExecutable : string ) {
23- const provider = new BazelCommandCodeLensProvider ( bazelExecutable ) ;
24- const r = this . commandCodelensProviderRegistry ;
25- BazelCommands . forEach ( command => {
26- r . registerCommandCodeLensProvider ( command , provider ) ;
27- } ) ;
28- }
29-
3022 async activate (
3123 ctx : vscode . ExtensionContext ,
3224 config : vscode . WorkspaceConfiguration ) : Promise < any > {
3325
3426 const cfg = await createBazelrcConfiguration ( ctx , config ) ;
35- this . registerBazelCommandCodeLensProviders ( cfg . run . executable ) ;
27+ registerBazelCommandCodeLensProviders ( this . commandCodelensProviderRegistry , cfg . run . executable ) ;
3628
3729 const codelens = new BazelrcCodelens ( cfg . run . executable , this . commandCodelensProviderRegistry ) ;
3830 this . disposables . push ( codelens ) ;
@@ -54,7 +46,7 @@ export class BazelrcFeature implements IExtensionFeature, vscode.Disposable {
5446 }
5547}
5648
57- class BazelCommandCodeLensProvider implements CommandCodeLensProvider {
49+ export class BazelCommandCodeLensProvider implements CommandCodeLensProvider {
5850 constructor (
5951 private bazelExecutable : string ,
6052 ) { }
@@ -97,3 +89,10 @@ function createRunCommand(runCtx: RunContext): vscode.Command {
9789 tooltip : `${ runCtx . command } ${ runCtx . args . join ( ' ' ) } ` ,
9890 } ;
9991}
92+
93+ export function registerBazelCommandCodeLensProviders ( registry : ICommandCodeLensProviderRegistry , bazelExecutable : string ) {
94+ const provider = new BazelCommandCodeLensProvider ( bazelExecutable ) ;
95+ BazelCommands . forEach ( command => {
96+ registry . registerCommandCodeLensProvider ( command , provider ) ;
97+ } ) ;
98+ }
0 commit comments