From f542fd8d1b09355682214e5dcf1923c07c1bbd58 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 21 Jun 2023 09:24:15 +0200 Subject: [PATCH] provider events --- apps/remix-ide/src/app/files/fileManager.ts | 8 +++++++- apps/remixdesktop/src/plugins/fsPlugin.ts | 5 ++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/remix-ide/src/app/files/fileManager.ts b/apps/remix-ide/src/app/files/fileManager.ts index b3c9a1fbc1..c35487f04f 100644 --- a/apps/remix-ide/src/app/files/fileManager.ts +++ b/apps/remix-ide/src/app/files/fileManager.ts @@ -447,7 +447,8 @@ class FileManager extends Plugin { browserExplorer: this._components.registry.get('fileproviders/browser').api, localhostExplorer: this._components.registry.get('fileproviders/localhost').api, workspaceExplorer: this._components.registry.get('fileproviders/workspace').api, - filesProviders: this._components.registry.get('fileproviders').api + filesProviders: this._components.registry.get('fileproviders').api, + electronExplorer: this._components.registry.get('fileproviders/electron').api, } this._deps.config.set('currentFile', '') // make sure we remove the current file from the previous session @@ -465,6 +466,11 @@ class FileManager extends Plugin { this._deps.workspaceExplorer.event.on('fileRemoved', (path) => { this.fileRemovedEvent(path) }) this._deps.workspaceExplorer.event.on('fileAdded', (path) => { this.fileAddedEvent(path) }) + this._deps.electronExplorer.event.on('fileChanged', (path) => { this.fileChangedEvent(path) }) + this._deps.electronExplorer.event.on('fileRenamed', (oldName, newName, isFolder) => { this.fileRenamedEvent(oldName, newName, isFolder) }) + this._deps.electronExplorer.event.on('fileRemoved', (path) => { this.fileRemovedEvent(path) }) + this._deps.electronExplorer.event.on('fileAdded', (path) => { this.fileAddedEvent(path) }) + this.getCurrentFile = this.file this.getFile = this.readFile this.getFolder = this.readdir diff --git a/apps/remixdesktop/src/plugins/fsPlugin.ts b/apps/remixdesktop/src/plugins/fsPlugin.ts index 6c4d462ae9..ea72ac5146 100644 --- a/apps/remixdesktop/src/plugins/fsPlugin.ts +++ b/apps/remixdesktop/src/plugins/fsPlugin.ts @@ -5,8 +5,8 @@ import chokidar from 'chokidar' import { dialog } from "electron"; import { createWindow } from "../main"; import { writeConfig } from "../utils/config"; -import { glob, globSync, globStream, globStreamSync, Glob, GlobOptions } from 'glob' -import { PathScurry, Path } from 'path-scurry' +import { glob, GlobOptions } from 'glob' +import { Path } from 'path-scurry' const profile: Profile = { displayName: 'fs', @@ -213,7 +213,6 @@ class FSPluginClient extends ElectronBasePluginClient { if (this.watcher) this.watcher.close() this.watcher = chokidar.watch(this.fixPath(path)).on('change', (path, stats) => { - //console.log('change', path, stats) this.emit('change', path, stats) }) }