'use strict' ; import { WebviewPanel , ViewColumn , CodeLens , TextDocument , Range , Command , Webview } from 'vscode' ; export interface WebviewAdapter { isVisible ( ) : boolean ; canReveal ( ) : boolean ; dispose ( ) : void ; reveal ( displayColumn ) : void ; html : string ; postMessage ( message ) : Thenable < boolean > ; readonly isInset : boolean ; readonly webview : Webview ; } export class WebviewPanelAdapter implements WebviewAdapter { constructor ( private panel ) { } canReveal ( ) { return true ; } dispose ( ) { this . panel . dispose ( ) ; } reveal ( displayColumn ? ) { this . panel . reveal ( displayColumn ) ; } isVisible ( ) { return this . panel . visible ; } public get html ( ) : string { return this . panel . webview . html ; } public set html ( value ) { this . panel . webview . html = value ; } postMessage ( message ) { return this . panel . webview . postMessage ( message ) ; } public get isInset ( ) : boolean { return false ; } public get webview ( ) : Webview { return this . panel . webview ; } } export class DocumentCodeLens extends CodeLens { constructor ( private document , range , command ? ) { super ( range , command ) ; } getDocument ( ) { return this . document ; } } export class DocumentInsetCodeLens extends DocumentCodeLens { constructor ( document , range , private line , command ? ) { super ( document , range , command ) ; } getLine ( ) { return this . line ; } }