Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Feature/filesystem watcher #2116

Merged
merged 12 commits into from
Apr 20, 2018
Merged

Conversation

akinsho
Copy link
Member

@akinsho akinsho commented Apr 18, 2018

@bryphe due to webpack changes in #2109 🎉 issues I was having getting chokidar the FileSystem watching package we discussed in #1506 finally works as expected 💯.

This PR is a an initial implementation of the FileSystemWatcher, Its basically a thin layer around chokidar event listeners which I in turn use to create event listeners we subscribe to in the explorer

Result is that creating new files or deleting new files causes the explorer to update correctly

watched

@bryphe
Copy link
Member

bryphe commented Apr 19, 2018

Very cool @Akin909 ! 👍

Just had a minor comment about watching for workspace changes, but the code change looks great!

return this._onChange
}

get onMove(): IEvent<IFileChangeEvent> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the abstraction a lot - and it seems like it'd be relatively straightforward for us to have a 'mock' implementation for tests, if we need it 👍


constructor(watch: IFSOptions = {}) {
this._workspace = Workspace.getInstance()
this._activeWorkspace = this._workspace.activeWorkspace
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering - would it make sense to hook the onDirectoryChanged event on Workspace? In that case, we'd probably want to remove the existing listeners from the old directory, and start listening to the 'new' directory.

@codecov
Copy link

codecov bot commented Apr 19, 2018

Codecov Report

Merging #2116 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2116   +/-   ##
=======================================
  Coverage   37.27%   37.27%           
=======================================
  Files         288      288           
  Lines       11608    11608           
  Branches     1556     1556           
=======================================
  Hits         4327     4327           
  Misses       7037     7037           
  Partials      244      244

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b96c4cf...d3c01bf. Read the comment docs.

@akinsho akinsho merged commit d2942f0 into onivim:master Apr 20, 2018
@akinsho akinsho deleted the feature/filesystem-watcher branch April 20, 2018 07:02
@akinsho akinsho restored the feature/filesystem-watcher branch April 20, 2018 07:14
@akinsho akinsho deleted the feature/filesystem-watcher branch April 20, 2018 08:01
akinsho added a commit that referenced this pull request Apr 20, 2018
@akinsho akinsho restored the feature/filesystem-watcher branch April 20, 2018 14:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants