import * as vscode from 'vscode' ; import { AZDocumentSymbolsLibrary } from "./azDocumentSymbolsLibrary" ; import { DevToolsExtensionContext } from "../devToolsExtensionContext" ; export class AZActiveDocumentSymbolsLibrary extends AZDocumentSymbolsLibrary { private _autoReload : boolean ; constructor ( context ) { super ( context , undefined ) ; this . _autoReload = true ; vscode . window . onDidChangeActiveTextEditor ( editor => { this . onActiveDocumentChanged ( ) ; } ) ; vscode . workspace . onDidChangeTextDocument ( e => { if ( ( this . isActiveDocument ( e . document ) ) && ( e . document . languageId != "al" ) ) this . onActiveDocumentChanged ( ) ; } ) ; vscode . workspace . onDidSaveTextDocument ( document => { if ( this . isActiveDocument ( document ) ) this . onActiveDocumentChanged ( ) ; } ) ; } protected onActiveDocumentChanged ( ) { if ( vscode . window . activeTextEditor ) this . setDocUri ( vscode . window . activeTextEditor . document . uri ) ; else this . setDocUri ( undefined ) ; if ( this . _autoReload ) this . loadAsync ( false ) ; } protected onActiveDocumentContentChanged ( ) { this . _reloadRequired = true ; if ( this . _autoReload ) this . loadAsync ( false ) ; } public isActiveDocument ( document ) { return ( ( ! ! vscode . window . activeTextEditor ) && ( ! ! document ) && ( vscode . window . activeTextEditor . document . uri . fsPath == document . uri . fsPath ) ) ; } public initializeContent ( ) { this . onActiveDocumentChanged ( ) ; } }