Community
Participate
Working Groups
"Use as a library folder", which was added to solve ticket #424340, causes the target folder to be excluded from validation. Unfortunately, searches still display the matches in these folders. A developer will sometimes want to search in external libraries to find a function definition, so the current behavior is not a bug, and is sometimes desirable. But a large part of searches look for code which needs to be changed, which excludes library folders. In general, these folders should be ignored. It would be necessary to allow control over this exclusion with a preference, or to distinguish 2 types of matches in the results, for example by adding a section for matches in library folders. My recommendation would be to add a "Ignore library folders" preference, which would be enabled by default.
Isn't the existing "Selected resources" scope option good enough for your use case? In the PHP Explorer you can select the folder(s) where you want to search in and then in the File Search wizard you can select the "Selected resources" radio button in the "Scope" group. The search will be executed only in the folder you have selected.
Another, even more flexible option, is to create a working set where you tailor the exact scope you want to search in. And then use the "Working set" option in the File Search wizard.
Kaloyan, the only scopes I used so far are Workspace and Project. If I select Selected resources, I am not asked to select resources. I am not finding documentation about this option. As for working sets, this is perhaps the most prominent Eclipse feature which I have never understood. I just looked at the documentation, but I find it abstract and I do not know what I should do. Your suggestions may help. I doubt Selected resources would be as useful as this request. As for working sets, I do not know.
(In reply to Filipus Klutiero from comment #3) > If I select Selected resources, I am not asked to select resources. This option is about resources that you have already selected before calling the File Search wizard. So: 1. First select one or more file/folders in the PHP Explorer view. 2. Call Search > File from main menu. 3. Select the "Selected resources" radio button. > As for working sets, this is perhaps the most prominent Eclipse feature > which I have never understood. I just looked at the documentation, but I > find it abstract and I do not know what I should do. Try the following: 1. Call Search > File from main menu. 2. Select the "Working set" option. 3. Click on the Choose button. 4. Click on the New button to create a new working set. 5. Select the Resource type. 6. Click on the Next button. 7. Give the working set a name. 8. Select the exact folders in the tree view where you want to search in. 9. Click on the Finish button. 10. Select the newly created working set. 11. Click the OK button. The working set is now selected as the search scope. Lots of clicking, but this is the most precise way to define a search scope. > Your suggestions may help. I doubt Selected resources would be as useful as > this request. As for working sets, I do not know. I, myself, am using "Selected resources" most often as it is the fasted way to select a good enough search scope.
I want mark this bug as WONTFIX. If you don't want library folder in search, just mark it as derived [1], eclipse by default ignore derived resources in "File Search" and "Open Resource" dialogs. We don't want mark it as derived by default because team providers by default trying to ignore such resources (for example EGit will create .gitignore for each derived folder). Anyway we should consider auto marking "vendor" dir in composer projects as derived, but via different bug. Any objections? [1] - https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2FresAdv_derived.htm
Thank you Dawid I do not know if derivation is a real solution, but marking the directory as derived does help a lot. Derived resources can be considered or not per-search, at least in the file search tab.
External libraries (the vendor directory) unfortunately do not match Eclipse's definition of Derived resources: https://help.eclipse.org/2021-06/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2FresAdv_derived.htm