import { ExtensionContext , workspace } from "vscode" ; import { LoadLogFile } from "./commands/LoadLogFile" ; import { ShowLogFile } from "./commands/ShowLogFile" ; import { Display } from "./Display" ; import { SymbolFinder } from "./SymbolFinder" ; import { VSWorkspace } from "./workspace/VSWorkspace" ; export class Context { symbolFinder = new SymbolFinder ( ) ; context : ExtensionContext ; display : Display ; workspaces : VSWorkspace [ ] = [ ] ; namespaces : string [ ] = [ ] ; constructor ( context , display ) { this . context = context ; this . display = display ; if ( workspace . workspaceFolders ) { this . workspaces = workspace . workspaceFolders . map ( ( folder ) => { return new VSWorkspace ( folder ) ; } ) ; } LoadLogFile . apply ( this ) ; ShowLogFile . apply ( this ) ; } findSymbol ( wsPath , symbol ) { const path = this . symbolFinder . findSymbol ( wsPath , symbol ) ; if ( ! path ) { this . display . showErrorMessage ( `Type '${ symbol }' was not found in workspace` ) ; } return path ; } }