provider events

rdesktop
filip mertens 1 year ago
parent 356d8ed3dc
commit e58d67345b
  1. 8
      apps/remix-ide/src/app/files/fileManager.ts
  2. 5
      apps/remixdesktop/src/plugins/fsPlugin.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

@ -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)
})
}

Loading…
Cancel
Save