Bug 429814 - [1.8] ICodeAssist#codeSelect should return lambda IMethod, not the overridden SAM of the functional interface
Summary: [1.8] ICodeAssist#codeSelect should return lambda IMethod, not the overridden...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted
Depends on:
Blocks: 430039
  Show dependency tree
 
Reported: 2014-03-06 14:31 EST by Markus Keller CLA
Modified: 2022-11-22 14:55 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2014-03-06 14:31:46 EST
ICodeAssist#codeSelect should return lambda IMethod, not the overridden SAM of the functional interface.

Once bug 429812 is fixed, the Javadoc hover should find the doc from the overridden method (already works for signatures that only contain primitive types).
Comment 1 Srikanth Sankaran CLA 2014-03-06 21:26:12 EST
Markus, Can this wait until later ? For one thing, there is no IJavaElement
for method references - they will have to return the sam binding anyway.

For lambdas also, could you cite what exactly breaks by having the sam binding
returned ? I agree the signatures should be fixed (https://bugs.eclipse.org/bugs/show_bug.cgi?id=429812) immediately.

For starters, I took the "these are expressions" view - At this point, it looks
to me that we should get the basic hover working for GA and look at all else
post GA, but soon.

If you think it is a must, we can document at the right place that this is what
these APIs are doing at the moment, but this is subject to change - I personally
think it is not necessary.
Comment 2 Markus Keller CLA 2014-03-07 14:20:54 EST
(In reply to Srikanth Sankaran from comment #1)
> Markus, Can this wait until later ? For one thing, there is no IJavaElement
> for method references - they will have to return the sam binding anyway.

Yes, I think it's safer to wait until after GA.

Javadoc of codeSelect(..) says: "Returns the Java elements corresponding to the given selected text". We use this element as the basis for many navigation/hover operations. E.g. the Open Implementation hyperlink should not appear for a lambda. Ctrl+T should also start on the lambda. And hovers should show the resolved type information for the lambda method, not generic type variables from the SAM.

Method references are a problem. So far, we said it's overkill to add IMethod elements for them. I need to think a bit more about that.
Comment 3 Markus Keller CLA 2014-03-10 06:11:48 EDT
(In reply to Markus Keller from comment #2)
> Method references are a problem.

Nope, no problem here. In contrast to lambdas, method references don't add a new method implementation, so we don't need an element for them.

The interesting properties of a method reference are
- the concrete referenced method (i.e. the right declaring class and the right overloading), and
- the inferred type arguments.
=> We're in the same position as with ordinary method invocations, where codeSelect already returns an IMethod that contains this resolved information.
Comment 4 Srikanth Sankaran CLA 2014-04-23 01:13:32 EDT
There is no owner for code assist as of now
Comment 5 Jay Arthanareeswaran CLA 2014-07-24 10:17:01 EDT
I will give it a try, but no promise on timeline yet.
Comment 6 Jay Arthanareeswaran CLA 2015-05-12 03:59:44 EDT
No progress on this. Will look at this during 4.6.
Comment 7 Jay Arthanareeswaran CLA 2016-04-05 04:33:26 EDT
No progress yet and unlikely to get time during 4.6. Moving out.
Comment 8 Manoj N Palat CLA 2018-05-21 06:07:11 EDT
Bulk move out of 4.8
Comment 9 Eclipse Genie CLA 2020-08-10 10:38:33 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 10 Eclipse Genie CLA 2022-11-22 14:55:29 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.