import { injectable } from 'inversify' ; import { CancellationToken , ConfigurationChangeEvent , Event , FileSystemWatcher , GlobPattern , Uri , workspace , WorkspaceConfiguration , WorkspaceFolder , WorkspaceFoldersChangeEvent , } from 'vscode' ; import { IWorkspaceService } from './types/workspace' ; @ injectable ( ) export class WorkspaceService implements IWorkspaceService { public get onDidChangeConfiguration ( ) : Event < ConfigurationChangeEvent > { return workspace . onDidChangeConfiguration ; } public get workspaceFolders ( ) : ReadonlyArray < WorkspaceFolder > | undefined { return workspace . workspaceFolders ; } public get onDidChangeWorkspaceFolders ( ) : Event < WorkspaceFoldersChangeEvent > { return workspace . onDidChangeWorkspaceFolders ; } public getConfiguration ( section ? , resource ? ) { return workspace . getConfiguration ( section , resource ) ; } public asRelativePath ( pathOrUri , includeWorkspaceFolder ? ) { return workspace . asRelativePath ( pathOrUri , includeWorkspaceFolder ) ; } public createFileSystemWatcher ( globPattern , ignoreCreateEvents ? , ignoreChangeEvents ? , ignoreDeleteEvents ? ) { return workspace . createFileSystemWatcher ( globPattern , ignoreCreateEvents , ignoreChangeEvents , ignoreDeleteEvents ) ; } public findFiles ( include , exclude ? , maxResults ? , token ? ) { return workspace . findFiles ( include , exclude , maxResults , token ) ; } }