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.

Bug 200297 - "Find ..." used on a subfolder does not ignore "Ignored Folders"
Summary: "Find ..." used on a subfolder does not ignore "Ignored Folders"
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.0.1
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on: 202171
Blocks:
  Show dependency tree
 
Reported: 2011-07-21 19:11 UTC by PeterSorg
Modified: 2011-12-16 10:11 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description PeterSorg 2011-07-21 19:11:55 UTC
The setting:
Source Files->Subfolder->Subfolder1.1
Source Files->Subfolder->Subfolder1.2 (Ignored by "ignored folders")

If you use "Find .." on "Subfolder", NB will find results in Subfolder1.2, which should be ignored.

If you use "Find .." on "Source Files" or on the Project-Root (on Project Tree) it will correctly ignore Subfolder1.2.

This is not the same Bug as descripted in Bug 178634.
Comment 1 Tomas Mysik 2011-09-15 06:25:46 UTC
The problem seems to be in the Search component since the FileObjectFilter (provided by PhpProject) is not used when calling Find on a folder underneath Source Files. The FileObjectFilter is called when searching on the project itself or on its Source Files node.

Please evaluate (steps in the initial description), thanks.
Comment 2 Jaroslav Havlin 2011-09-15 08:26:00 UTC
You are right, Tomas. Missing FileObjectFilter causes this.

FileObjectFilters are set in SearchInfo instances, that are stored 
in lookups of nodes. If no SearchInfo is registered in node's lookup, 
default SearchInfo is used.

So, the primary problem is that the node representing folder "Subfolder" 
does not contain correct SearchInfo in its lookup.

I think that the only way to fix this is currently to add correct 
SearchInfo to all folders underneath the project root.

Unfortunately, recursively searching for parent node with registered 
SearchInfo is not an option here, as FileObjectFilters are encapsulated 
in SearchInfo instances and are not publicly visible.

But we could change API and (a) introduce method SearchInfo.getFilters 
(returning list of FileObjectFilters), or (b) register lists 
of FileObjectFilters to lookups of nodes. 
Then we could recursively search for the nearest parent with
these settings from any sub-folder.

Please, are you able to add custom SearchInfo to all project folders?
Would you prefer some API changes?
Thank you.
Comment 3 Tomas Mysik 2011-09-15 09:45:34 UTC
(In reply to comment #2)
> But we could change API and (a) introduce method SearchInfo.getFilters 
> (returning list of FileObjectFilters), or (b) register lists 
> of FileObjectFilters to lookups of nodes. 
> Then we could recursively search for the nearest parent with
> these settings from any sub-folder.

Well, I don't know this area at all, but I would perhaps prefer the (b) option since it would - at least I hope - avoid any regression; or, do you think that the (a) option could cause any regression or unexpected behavior in the existing code?

> Please, are you able to add custom SearchInfo to all project folders?

This should be possible but I'm not sure whether it is the "right" thing to do, see above. Also, that would mean to create as many SearchInfo instances as Subfolder nodes, right? I would definitely prefer to create one instance of *something* and share it or put it to the lookup of the root node. Does it make sense? Of course, this would be tailored exactly for this situation, not sure whether it is a common (or the most common) use case or not...

Anyway, I will try to do it. I will update this issue soon.

Thanks.
Comment 4 Tomas Mysik 2011-09-15 10:17:19 UTC
(In reply to comment #3)
> Anyway, I will try to do it. I will update this issue soon.

It works for me now, so reassigning back and fixing.

http://hg.netbeans.org/web-main/rev/44a178ed6b66

However, I have filed issue #202171, feel free to close/change/fix it. If the issue #202171 is fixed, this fix can be removed/simplified.

Thanks.
Comment 5 Jaroslav Havlin 2011-09-15 11:29:13 UTC
Thank you very much, Tomas.
Comment 6 Tomas Mysik 2011-09-15 11:43:44 UTC
(In reply to comment #5)
> Thank you very much, Tomas.

Nothing to thank for.
Comment 7 Quality Engineering 2011-09-17 14:25:24 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/44a178ed6b66
User: Tomas Mysik <tmysik@netbeans.org>
Log: #200297 - "Find ..." used on a subfolder does not ignore "Ignored Folders"
Comment 8 PeterSorg 2011-12-16 09:19:34 UTC
Thanx. You are hero :)
Comment 9 Tomas Mysik 2011-12-16 10:11:29 UTC
(In reply to comment #8)
> Thanx. You are hero :)

No way :)