import * as vscode from 'vscode' ; import { ExtensionComponent } from '../extensionComponent' ; see CodeLensManager export abstract class AbstractCodeLensProvider implements vscode . CodeLensProvider , ExtensionComponent { onDidChangeCodeLenses ? : vscode . Event < void > | undefined ; constructor ( private _documentSelector ) { } param document protected abstract getDependenciesPos ( document ) ; param document provideCodeLenses ( document ) { let dependenciesPos = this . getDependenciesPos ( document ) ; let range = new vscode . Range ( dependenciesPos [ 0 ] , dependenciesPos [ 1 ] ) ; return [ new vscode . CodeLens ( range , { command : 'jfrog.xray.refresh' , title : 'Start xray scan' } as vscode . Command ) ] ; } public activate ( context ) { context . subscriptions . push ( vscode . languages . registerCodeLensProvider ( this . _documentSelector , this ) ) ; } }