Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 484454 - Missing method reference in Search view
Summary: Missing method reference in Search view
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-16 01:42 EST by Manoj N Palat CLA
Modified: 2015-12-16 04:28 EST (History)
3 users (show)

See Also:


Attachments
Test case to reproduce the issue (328 bytes, text/plain)
2015-12-16 01:42 EST, Manoj N Palat CLA
no flags Details
Screenshot (31.16 KB, image/png)
2015-12-16 02:09 EST, Noopur Gupta CLA
no flags Details
Search View (14.31 KB, image/jpeg)
2015-12-16 02:52 EST, Manoj N Palat CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Manoj N Palat CLA 2015-12-16 01:42:24 EST
Created attachment 258711 [details]
Test case to reproduce the issue

In the given test case, search for references of wrint, the method reference is not highlighted and not shown as well. However, the total references is shown as 2, though. If the lambda is commented, the reference expression is highlighted.

From the JDT Core, a SearchMatch is created for this reference expression and the requestor.acceptSearchMatch() is called.

As a follow-up of bug 484367 comment 1
Comment 1 Noopur Gupta CLA 2015-12-16 02:09:18 EST
Created attachment 258712 [details]
Screenshot

With Neon M4 build, I see the method reference is highlighted.
See attached screenshot.
Comment 2 Manoj N Palat CLA 2015-12-16 02:50:14 EST
Let me rephrase it: In Search view, only the lambda is shown and not the reference [yes there is highlighting but no clickable item in search view for method reference]
Comment 3 Manoj N Palat CLA 2015-12-16 02:52:40 EST
Created attachment 258714 [details]
Search View

Only the lambda has a clickable option in Search View
Comment 4 Noopur Gupta CLA 2015-12-16 04:28:00 EST
You can click on "test()" or use the search view arrows to navigate to the method reference match.

For method reference match [3], NewSearchResultCollector.acceptSearchMatch(SearchMatch match) receives SearchMatch.getElement() as the ResolvedSourceMethod "test()". 
The same is true for [1] here:
	public void test(){
		new BarImpl().wrint(); // [1]
		Foo foo1 = (bar)->bar.wrint(); // [2]
		Foo foo = Bar::wrint; // [3]
	}
Hence, both [1] and [3] are shown with test() node.

For [2], SearchMatch.getElement() is the LambdaMethod with parent LambaExpression and hence it is shown in that way in the tree.