Skip to content

Smart file watching #24

@fogzot

Description

@fogzot

As discussed in #19 and other issues watching the full solution tree sometimes results in too many open files errors, especially when one uses client-side package managers like npm or bower. A solution could be to watch single directories, excluding problematic ones. My idea is to:

  1. Extract project structure information from both the solution file and the top-level global.json "projects" key and use a bit of euristic (see later) to determine which subdirectories should be watched for changes.
  2. Look for exclude patterns in each subdirectory: this could be made configurable but ignoring node_modules, bower_packages and other well-known names is probably a good start.
  3. For each subdirectory that doesn't contain anything to ignore just create a single watcher.
  4. For each subdirectory that contains something to ignore creare a top-level watcher with IncludeSubdirectories set to false and then one watcher for every directory.

We will end up with more watchers than strictly necessary but, given that one usually doesn't have tens of directories inside each project, not that much more.

Does this seems sensible or am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions