-
Notifications
You must be signed in to change notification settings - Fork 418
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
Support watching file extensions. #1053
Support watching file extensions. #1053
Conversation
0c03755
to
35c5738
Compare
@@ -9,8 +9,8 @@ public interface IFileSystemWatcher | |||
/// <summary> | |||
/// Call to watch a file or directory path for changes. | |||
/// </summary> | |||
/// <param name="fileOrDirectoryPath">The file or directory path to watch.</param> | |||
/// <param name="pathOrExtension">The file or directory path to watch.</param> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, you could watch for files of any extension in a given directory. With this change, you can watch files of a given extension in any directory. However, there's still no way to watch files of a specific extension in a specific directory, and no way to watch all files in across all directories that omnisharp receives notifications about.
Maybe we should instead add an API that lets you subscribe to all notifications across all directories and let event subscribers handle filtering on extension/change type. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a general need for globbing patterns support in OmniSharp - for example in case you define excluded paths in VS Code configuration, at the moment, OmniSharp doesn't know about that and still scans everything. I think what you suggest here could be developed together with a general globbing support in OmniSharp but personally I wouldn't hold up on this PR because it unblocks a very nice, and very welcome functionality that we've been missing for a while - watching for script and cake files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rchande @filipw I’m fine either way. I actually started out with a glob pattern matchet before @rchande pushed the improvements to FileSystemWatcher, but never really finishef since I never made friends with Microsoft.Extensions.Filesystem.Globbing
. After discussion with @DustinCampbell in Slack we came tovthe conclusion that a simple WatchExtension
would be sufficient to support wath we currently need for Scripting and Cake. I’ll let you decide on how to move forward and adjust this PR accordingly 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm the typos. It’s just me having a hard time texting on an iPhone..
35c5738
to
a54c6dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Was the request for changes on this PR resolved before merging? |
@DustinCampbell well @rchande's original request to support watching every file was not implemented as @filipw thought this was ok for now and we should add glob-support instead in a future PR. |
No problem. I just wanted to check. |
This will allow possibility to dynamically add
.csx
and.cake
files to workspace.Separate PR's for using this in
CakeProjectSystem
andScriptProjectSystem
is coming soon.