Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect when files move to empty directories #1368

Merged
merged 10 commits into from
Jan 15, 2019

Conversation

rchande
Copy link

@rchande rchande commented Dec 19, 2018

Augment the IFileSystemWatcher to allow watching a directory
recursively. This enables OmniSharp to watch a project's entire
directory tree (as oppposed to the specific subdirectories that contain
documents)

Augment the IFileSystemWatcher to allow watching a directory
recursively. This enables OmniSharp to watch a project's entire
directory tree (as oppposed to the specific subdirectories that contain
documents)
@SirIntruder
Copy link
Contributor

Glad to see this issue finally getting on the chopping block! Yet, I have questions 😆

  1. Wouldn't this result in double trigger of "OnDocumentChanged" when doing stuff in existing directories?

  2. Seems there is an arbitrary limitation of only one "WatchRecursively" listener being able to be triggered per event?

Looking at this, I wonder can't MSBuildProjectmanager just subscribe to all "*.cs" on start instead of doing anything per directory? BufferManager will put new files into correct projects, and others will be forwarded to the misc project. If anything, it should make dispatching events in ManualSystemWatcher cheaper, as it would replace 100s of hooks with just one (note that ManualSystemWatcher is not a real system file watcher, it just re-distributes upstream events coming from /fileChanged endpoint. I was confused by this at first)

@rchande
Copy link
Author

rchande commented Dec 19, 2018

@SirIntruder

I wonder can't MSBuildProjectmanager just subscribe to all "*.cs" on start instead of doing anything per directory?

Interesting idea. Let's see what the tests have to say about that...

@rchande
Copy link
Author

rchande commented Dec 19, 2018

And of course, if that's a good solution, maybe we can get rid of the "FileSystemWatcher" concept altogether, since as you say, it's more of an abstraction for controlling what events from the "real" file system get handled.

@rchande
Copy link
Author

rchande commented Jan 9, 2019

@filipw care to review?

Copy link
Member

@filipw filipw left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@filipw filipw merged commit 23d5be9 into OmniSharp:master Jan 15, 2019
@rchande rchande deleted the dev/rchande/detectFileMoves branch January 22, 2019 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants