This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Add ignored folders to HTML5 project | ||
---|---|---|---|
Product: | web | Reporter: | Vladimir Riha <vriha> |
Component: | HTML Project | Assignee: | Tomas Mysik <tmysik> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ain, avandecreme, corvae, dholzgang, dusty, guoyunhebrave, hindsholm, jdoe_12345, nikolayivanovivanov, pjiricka, stophi, zimmi |
Priority: | P2 | ||
Version: | 8.0.2 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: |
nbpoject folder
Support for .nbignore files Sources of nbignore module |
Description
Vladimir Riha
2013-11-22 16:44:23 UTC
*** Bug 238638 has been marked as a duplicate of this bug. *** *** Bug 239399 has been marked as a duplicate of this bug. *** This would be great to have.. please include! Not sure why you would discriminate with this option having only in projects such as PHP or Java.. and not HTML. ember-cli uses a .tmp-directory next to the project files for intermediate js cross-compilation results and things like that. I suspect that this is responsible for some slowdown of NetBeans, but I haven't checked. I need to save the javascript source and minified files are under the same project. This makes a mess. I need to ignore the folder with the minified js files. It seems that there are many use cases where the "Ignore folders" feature is needed. Please, we need it! Consider using a different project structure, something like: project ├── doc <-- NetBeans shows it only in Files view ├── resources <-- NetBeans shows it only in Files view ├── public_html <-- Site Root in Projects view ├── test <-- Unit Tests in Projects view └── tmp <-- NetBeans shows it only in Files view This could help, I hope. (In reply to Tomas Mysik from comment #6) > Consider using a different project structure, something like: > > project > ├── doc <-- NetBeans shows it only in Files view > ├── resources <-- NetBeans shows it only in Files view > ├── public_html <-- Site Root in Projects view > ├── test <-- Unit Tests in Projects view > └── tmp <-- NetBeans shows it only in Files view > > This could help, I hope. Good suggestion, but the minified js and css files (if you use sass) are needed under the public_html (or www in my case) directory. Will netbeans ignores some of the folders under public_html if I name them in a certain way? When working on php projects we just add them to the ignore list. (In reply to nikolayivanovivanov from comment #7) > Will netbeans ignores some of the folders under public_html if I name them > in a certain way? See Tools > Options > Miscellaneous > Files, feel free to update the regular expression [1]. HTH. [1] ^(CVS|SCCS|vssver.?\.scc|#.*#|%.*%|_svn)$|~$|^\.(?!(htaccess|git.+|hgignore|npmignore|jshintrc|bowerrc|travis\.yml)$).*$ Changing the regex is not going to help the issue. The node_modules folder contains filetypes that can be found within the projects, .js files, for example. I can't exclude all .js files in my projects. It needs to be based on the folder. As an example of how necessary this is for HTML5 projects using NPM, Grunt, Bower, etc., the webapp I'm working on has a node_modules folder that's 61.5 MB (90 on disk) containing 10,170 files. This means that whenever I start up NetBeans, it takes 15 minutes to scan all those files and actually finish opening the project. (In reply to jdoe_12345 from comment #10) > As an example of how necessary this is for HTML5 projects using NPM, Grunt, > Bower, etc., the webapp I'm working on has a node_modules folder that's 61.5 > MB (90 on disk) containing 10,170 files. This means that whenever I start up > NetBeans, it takes 15 minutes to scan all those files and actually finish > opening the project. @jdoe_12345: This can be solved by better project structure, I guess. Something like: project/ ├── node_modules └── public_html -> set this as Site Root With this project structure, NetBeans will "ignore" (do not scan & index) node_modules directory at all. Thanks. (In reply to Tomas Mysik from comment #11) Nope. I already have a project directory structure like that: project/ ├── bower_modules/ ├── nbproject/ ├── node/ ├── node_modules/ ├── src/ -> Site Root folder: project/src/main/webapp ├── target/ └── template/ and NetBeans still scans and indexes the entirety of bower_modules, node, and node_modules (In reply to jdoe_12345 from comment #12) > and NetBeans still scans and indexes the entirety of bower_modules, node, > and node_modules In such case, feel free to attach your nbproject folder here, I will look at it. But please first verify that it does not contain any private information. Thanks. Created attachment 155429 [details]
nbpoject folder
(In reply to jdoe_12345 from comment #14) > Created attachment 155429 [details] > nbpoject folder Looking into your project metadata, only src/main/js and src/main/webapp should be scanned & indexed by NetBeans. If it is not true, please, create a sample project, submit a new bug report and attach the project to it. Thanks. *** Bug 254918 has been marked as a duplicate of this bug. *** Not all of us have the ability to change project structure. Any news on this and is there anything I can do to speed this feature up? I think the best solution would parse the package.json file and filter out dev dependencies so they do not get indexed and parsed. (In reply to jockeeriksson from comment #18) > Any news on this No news, sorry :/ > and is there anything I can do to speed this feature up? The best would be to attach a patch here, of course :) Thanks. OK I will take a stab at this. I can see three approaches here. 1) Just implement the same functionality that php projects have, where you can add ignore folders. This is the easiest solution and probably the most robust. The problem is that we could loose some intelligent code completion because some folders are not scanned if you would add the node_modules folder. You could exclude every item separably I guess but it would be a hassle. 2) We could also parse the package.json if it exist and filter out any folder in the node_modules folder that is not a regular dependency. 3) All the above. What do you think? Ok I started on this task and halfway through I realized I could fix my issue just by not specifying a site root. But still I think dependencies that are bundled with the application should be indexed to get the best code completion possible. This will get even more important when we get ES6 support. I suppose that the files in .gitignore could be ignored by default... One idea - what could be done now is to add a support for marking hidden folders using a special file (e.g. ".nbignore"); in other words, every folder containing this file would be ignored by NetBeans. Opinions? Should I prepare a test module (*.nbm) for this functionality? Let me know, thanks. (In reply to Tomas Mysik from comment #23) > One idea - what could be done now is to add a support for marking hidden > folders using a special file (e.g. ".nbignore"); in other words, every > folder containing this file would be ignored by NetBeans. > > Opinions? Should I prepare a test module (*.nbm) for this functionality? > > Let me know, thanks. I'd really like that. It seems a good solution for now, and fairly flexible. (In reply to Tomas Mysik from comment #23) > One idea - what could be done now is to add a support for marking hidden > folders using a special file (e.g. ".nbignore"); in other words, every > folder containing this file would be ignored by NetBeans. > > Opinions? Should I prepare a test module (*.nbm) for this functionality? > > Let me know, thanks. Polluting a source tree with tool-specific files doesn't sound like a good idea. If the configuration is stored in a separate tool configuration hierarchy, that would sound better. (In reply to gnhki from comment #25) > Polluting a source tree with tool-specific files doesn't sound like a good > idea. I agree. The point is that the solution I proposed can be done _very_ easily (likely this week). > If the configuration is stored in a separate tool configuration > hierarchy, that would sound better. I agree again. Unfortunately, this is totally out-of-scope, at least for now, sorry. Of course, patches are more than welcome! :) So, please, let me know if I should try to prepare the NBM file with the solution I proposed earlier. Thanks for your feedback. As Voltaire said "The better is the enemy of the good". I vote for the quick fix; it's better to get something done imperfectly than to do nothing perfectly. Created attachment 158182 [details]
Support for .nbignore files
This NBM should work in NetBeans 9.1 as well as in the development version of NetBeans.
I just attached the NBM file, feel free to test it (Tools > Plugins > Downloaded). As I already wrote, I would also prefer to have a UI in the Project Properties dialog and store this option in the nbproject directory but this is not doable right now, sorry. Please, let me know whether the plugin works for you (so we could add it to the plugin portal maybe?). Thanks! (In reply to Tomas Mysik from comment #28) > This NBM should work in NetBeans 9.1 I meant NB 8.1, of course! :) One note: this plugin could have some impact on the performance (it is touching the HDD but I hope the impact will be not visible at all). Thanks. Last note, I promise :) This plugin works in all project types, not only HTML5 project, of course. (In reply to Tomas Mysik from comment #28) > Created attachment 158182 [details] > Support for .nbignore files > > This NBM should work in NetBeans 9.1 as well as in the development version > of NetBeans. Hi Tomas... Works for me! Thanks for the (very ;-) prompt fix. System information for your records: Product Version: NetBeans IDE 8.1 (Build 201510222201) Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM 25.60-b23 Runtime: Java(TM) SE Runtime Environment 1.8.0_60-b27 System: Linux version 3.16.0-4-amd64 running on amd64; UTF-8; en_US (nb) Debian 8.2 (Jessie) (In reply to dholzgang from comment #33) > Works for me! Great to hear! Thanks for letting me know. > Thanks for the (very ;-) prompt fix. You are welcome, of course. Thanks. Created attachment 158219 [details]
Sources of nbignore module
Attaching sources of nbignore module (to avoid loosing them :)
Please note that module Support for .nbignore files is now in contrib reposiry and its NBM file can be found here [1]. I consider this issue to be fixed. Thanks. [1] http://deadlock.netbeans.org/job/nbms-and-javadoc/lastSuccessfulBuild/artifact/nbbuild/nbms/extra/org-netbeans-modules-nbignore.nbm |