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

Ignoring some more files? #19

Open
fogzot opened this issue Jan 31, 2016 · 6 comments
Open

Ignoring some more files? #19

fogzot opened this issue Jan 31, 2016 · 6 comments

Comments

@fogzot
Copy link
Contributor

fogzot commented Jan 31, 2016

This is related to #15 - real projects, especially web ones, have tons of files that will never be opened in the IDE, like everything found in node_modules or bower_components: what about ignoring them too? Should this be a configuration option? And if we have VCS what about ignoring all ignored files, e.g., ones that match .gitignore?

Also, some directories should really be presented as dependencies but this is probably the work of a different MD/XS addin. Is the "Dependencies" folder available to other addins using an extension poiunt or should every one implement its own?

@mrward mrward changed the title Ignoring some more fies? Ignoring some more files? Jan 31, 2016
@mrward
Copy link
Owner

mrward commented Jan 31, 2016

Issue #15 was more to do with watching changes for files. Excluding directories from the file watcher if they exist inside the project's directory would mean you would have to create a file watcher for each directory inside the project's directory. I suspect we do not want to do that. I can see that node_modules could contain lots of files. The file watcher problem is only on Mono. On Windows it is fine. If this is a big problem we could also look at not using a file watcher and just using the IDE to indicate a file has changed. It would mean that changes made outside of the IDE, such as adding a new file to a directory, would not be detected, but maybe that is OK. Although the IDE does not update currently if a new file is added directly into a directory.

It sounds like this particular issue is more to do with what files to show in the Solution window.

[ ] Excluding directories in Solution window
[ ] Excluding files ignored by version control in Solution window
[ ] Extending the dependencies folder

Excluding directories

The project.json file has an exclude section:

"exclude": [
    "node_modules",
    "bower_components"
  ]

Perhaps this can be used. Although I have seen wwwroot in this exclude section.

Excluding files ignored by version control

The DNX addin would need to depend on the version control addin and presumably there is a way to see if a file is ignored. The DNX addin would ideally not be aware of Git or Subversion.

Extending the dependencies folder

Making the dependencies folder extensible by other addins in a simple way makes sense. I have not thought that far ahead yet. I think for some of the dependencies, such as bower, support for them may just be added into the DNX addin for now.

With MonoDevelop I put all the NuGet dependencies under the Dependencies folder. In Visual Studio they use the References folder for NuGet dependencies, but use the Dependencies folder for Bower and Node. The main reason was that the References node could not easily be replaced in MonoDevelop but also because the project.json has all the NuGet packages inside a dependencies section.

@fogzot
Copy link
Contributor Author

fogzot commented Feb 3, 2016

I think that the exclude section in project.json is about excluding directories that don't contain sources to be compiled. I have seen wwwroot and other directories that one would like to have in the solution pad in it, so using it for that is probably a bad idea. Hiding the files ignored by the version control addin is probably a good idea given that they are usually artifacts or generated files, rarely edited by the user.

@tobz
Copy link

tobz commented Mar 9, 2016

Just throwing in my two cents here: this really hurts trying to do any sort of develop with npm usage. Having node_modules present in the solution directory totally breaks the DNX stuff, as far as dependencies, when opening said solution. The whole too many open files thing.

It'd be great if we could add manual configurability, or standardize on project.json's exclude parameter. Even if it's not perfect, it would provide the simplest 90% solution, it seems like.

The only working approach for me right now is to move my entire solution into a directory below all of my node/webpack/etc stuff so that the DNX code doesn't "see" node_modules and get choked up watching the files. It's not the worst, but like... there's gotta be a better way. The pain is real. :P

@tobz
Copy link

tobz commented Mar 9, 2016

Also, FWIW, I'm not opposed to working on a PR for something like this, but it would be nice to hash out an agreed upon approach here in the origin issue, so to speak.

@mrward
Copy link
Owner

mrward commented Mar 9, 2016

@tobz - The issue here is about what to show in the solution window not how the files are monitored. There was a change made to monitor only the source directories and not the entire solution directory however this will not help node_modules since that directory is inside the project's directory.

I think the only real solution to this is to not use a file watcher at all. Xamarin Studio can detect changes to files made outside of the IDE, at least if you switch away and then back to the IDE. This approach may miss new files added outside the IDE though but maybe that is something we can live with. I can take a look at doing this - possibly leaving the file watcher as an alternative approach but disabled by default

@fogzot
Copy link
Contributor Author

fogzot commented Mar 9, 2016

We're discussing very different things here, my fault. I opened #24 to discuss how to manage file watching while keeping here the discussion about what to show in the solution pad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants