(folder: vscode.Uri, apiClient: ApiClient)
| 18 | onChangeFileDecosEmitter: vscode.EventEmitter<vscode.Uri>; |
| 19 | |
| 20 | constructor(folder: vscode.Uri, apiClient: ApiClient) { |
| 21 | console.log("botloader: adding script workspace folder:", folder); |
| 22 | this.folder = folder; |
| 23 | this.apiClient = apiClient; |
| 24 | |
| 25 | this.scm = vscode.scm.createSourceControl("botloader", "BotLoader", this.folder) as BotloaderSourceControl; |
| 26 | this.scm.isBotloaderSourceControl = true; |
| 27 | |
| 28 | this.scm.inputBox.visible = false; |
| 29 | this.changedFilesGroup = this.scm.createResourceGroup(CHANGED_FILES_SCM_GROUP, "Changed scripts"); |
| 30 | |
| 31 | const watcherPattern = new vscode.RelativePattern(this.folder, "*.ts"); |
| 32 | console.log("Watcing: ", watcherPattern); |
| 33 | const watcher = vscode.workspace.createFileSystemWatcher(watcherPattern); |
| 34 | console.log(watcher); |
| 35 | |
| 36 | this.onChangeFileDecosEmitter = new vscode.EventEmitter(); |
| 37 | |
| 38 | this.disposables.push(watcher); |
| 39 | this.disposables.push(vscode.window.registerFileDecorationProvider(this)); |
| 40 | |
| 41 | this.scm.quickDiffProvider = { |
| 42 | provideOriginalResource: ((uri: vscode.Uri, cancel: vscode.CancellationToken) => { |
| 43 | return this.provideOriginalResource(uri, cancel); |
| 44 | }).bind(this), |
| 45 | }; |
| 46 | |
| 47 | watcher.onDidChange(this.onFileDidhange.bind(this)); |
| 48 | watcher.onDidCreate(this.onFileDidCreate.bind(this)); |
| 49 | watcher.onDidDelete(this.onFileDidDelete.bind(this)); |
| 50 | |
| 51 | this.syncWorkspace(); |
| 52 | } |
| 53 | |
| 54 | get onDidChangeFileDecorations(): vscode.Event<vscode.Uri | vscode.Uri[] | undefined> | undefined { |
| 55 | return this.onChangeFileDecosEmitter.event; |
nothing calls this directly
no test coverage detected