Bug 505824 - File Search: Please allow ignoring library folders
Summary: File Search: Please allow ignoring library folders
Status: REOPENED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: PHP UI CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-12 15:32 EDT by Nobody - feel free to take it CLA
Modified: 2021-08-02 17:13 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nobody - feel free to take it CLA 2016-10-12 15:32:09 EDT
"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.
Comment 1 Kaloyan Raev CLA 2016-10-13 02:17:31 EDT
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.
Comment 2 Kaloyan Raev CLA 2016-10-13 02:22:41 EDT
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.
Comment 3 Nobody - feel free to take it CLA 2016-10-13 09:29:52 EDT
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.
Comment 4 Kaloyan Raev CLA 2016-10-18 05:13:18 EDT
(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.
Comment 5 Dawid Pakula CLA 2018-02-07 11:44:40 EST
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
Comment 6 Nobody - feel free to take it CLA 2021-03-02 16:42:28 EST
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.
Comment 7 Nobody - feel free to take it CLA 2021-08-02 17:13:45 EDT
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