Bug 553112 - PHP Editor not capable with search scope "Resource in active editor"
Summary: PHP Editor not capable with search scope "Resource in active editor"
Status: VERIFIED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PHP UI CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-15 11:46 EST by Jonh Doe CLA
Modified: 2020-05-14 10:16 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 Jonh Doe CLA 2019-11-15 11:46:58 EST
I press Ctrl+H for open global search dialog.
I use tab "File Search".
"Scope" group list 3 radio buttons
1. Workspace | 2. Selected resources | 3. Enclosing project.

If I select option 2 - "Selected resources" search found nothing with message
"0 matches in empty scope".

So it is look like PHP editor do not capable with this option.

For example I can press Ctrl+H in any other editor like Java Editor or Type Script editor. Here I see second item named as "Resource in active editor", not as "Selected resources". And it is work exactly as intended - limit search scope only to file opened in active editor.
Comment 1 Jonh Doe CLA 2019-11-15 11:48:58 EST
I press Ctrl+H when PHP editor is active.
Comment 2 Jonh Doe CLA 2019-11-15 13:09:43 EST
With plug-in "UI Inspector for Eclipse"
https://sourceforge.net/projects/rcpinspect/
I try find source of problem.

Labels meaning:
ScopePart_selectedResourcesScope_text=Selecte&d resources
ScopePart_selectedResourcesScope_text_editor=Resource in active e&ditor
From here: https://github.com/eclipse/eclipse.platform.text/blob/master/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.properties#L190

Here relevant part code of Eclipse for set second radio button text:
https://github.com/eclipse/eclipse.platform.text/blob/fbe99e2e4da55425ce6b8f66d9277017ccb44735/org.eclipse.search/search/org/eclipse/search/internal/ui/ScopePart.java#L210
As I see `selectedResourcesFromContainer(fSearchDialog).size()` return 0, so label set as ScopePart_selectedResourcesScope_text.

Method selectedResourcesFromContainer:
https://github.com/eclipse/eclipse.platform.text/blob/fbe99e2e4da55425ce6b8f66d9277017ccb44735/org.eclipse.search/search/org/eclipse/search/internal/ui/ScopePart.java#L166

Here I stuck because not know much about how Eclipse plugins work. But maybe it help in some way.
Comment 3 Jonh Doe CLA 2019-11-15 13:15:20 EST
Also I want mention "CSS editor" is capable for "Resource in active e&ditor" option.

It can be more suitable for test rather "Java Editor" or "Type Script editor" because it present in PDT by default.

Or "XML editor". Too work.
Or "Text editor".
Comment 4 Eclipse Genie CLA 2019-11-15 14:12:44 EST
New Gerrit change created: https://git.eclipse.org/r/152745
Comment 6 Dawid Pakula CLA 2019-11-15 16:23:03 EST
Thank You for detailed report ;)
Comment 7 Jonh Doe CLA 2019-11-18 12:46:53 EST
Any chance for test nightly build on my Eclipse?

Eclipse IDE for PHP Developers

Version: 2019-03 (4.11.0)
Build id: 20190314-1200

https://download.eclipse.org/tools/pdt/updates/latest-nightly/
not install 7.0 version.
It suggest use 6.0 version. Even not 6.3.1 installed now.
Comment 8 Dawid Pakula CLA 2019-11-19 01:30:35 EST
You need 2019-09 and DLTK 6 (currently is nightly).

DLTK repo: http://download.eclipse.org/technology/dltk/updates-dev/latest-nightly/
Upgrade to 2019-09 is simple: https://wiki.eclipse.org/FAQ_How_do_I_upgrade_Eclipse_IDE%3F
Comment 9 Jonh Doe CLA 2019-11-19 17:08:02 EST
Thanks. It is work.

I only do update Eclipse from http://download.eclipse.org/releases/2019-09/
All other it do self.
Maybe because I add all other update sites before.

I not installed DLTK 6 manually.

Can confirm issue fixed now. Thanks for fast fix.
Comment 10 Dawid Pakula CLA 2019-11-19 17:10:24 EST
PDT is still compatible with DLTK 5.x But 6.0 fixes problem with frozing during startup ;)