import { injectable } from 'inversify' ; import { Event , TextDocument , TextDocumentShowOptions , TextEditor , TextEditorOptionsChangeEvent , TextEditorSelectionChangeEvent , TextEditorViewColumnChangeEvent , Uri , ViewColumn , window , workspace } from 'vscode' ; import { IDocumentManager } from './types' ; @ injectable ( ) export class DocumentManager implements IDocumentManager { public get textDocuments ( ) : TextDocument [ ] { return workspace . textDocuments ; } public get activeTextEditor ( ) : TextEditor | undefined { return window . activeTextEditor ; } public get visibleTextEditors ( ) : TextEditor [ ] { return window . visibleTextEditors ; } public get onDidChangeActiveTextEditor ( ) : Event < TextEditor | undefined > { return window . onDidChangeActiveTextEditor ; } public get onDidChangeVisibleTextEditors ( ) : Event < TextEditor [ ] > { return window . onDidChangeVisibleTextEditors ; } public get onDidChangeTextEditorSelection ( ) : Event < TextEditorSelectionChangeEvent > { return window . onDidChangeTextEditorSelection ; } public get onDidChangeTextEditorOptions ( ) : Event < TextEditorOptionsChangeEvent > { return window . onDidChangeTextEditorOptions ; } public get onDidChangeTextEditorViewColumn ( ) : Event < TextEditorViewColumnChangeEvent > { return window . onDidChangeTextEditorViewColumn ; } public get onDidOpenTextDocument ( ) : Event < TextDocument > { return workspace . onDidOpenTextDocument ; } public get onDidCloseTextDocument ( ) : Event < TextDocument > { return workspace . onDidCloseTextDocument ; } public get onDidSaveTextDocument ( ) : Event < TextDocument > { return workspace . onDidSaveTextDocument ; } public showTextDocument ( document , column ? , preserveFocus ? ) ; public showTextDocument ( document , options ? ) ; public showTextDocument ( uri , options ? , preserveFocus ? ) { return window . showTextDocument ( uri , options , preserveFocus ) ; } }