Bug 567556 - No Chain completion proposals for method parameters
Summary: No Chain completion proposals for method parameters
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.17   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-02 15:36 EDT by Mickael Istria CLA
Modified: 2023-02-24 03:36 EST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mickael Istria CLA 2020-10-02 15:36:41 EDT
I'm trying to complete: `Instant.now().compareTo(|)` at | location
EXPECTED: when cycling to chain completion, some chain proposals eg `Instant.now()`
GOT: No chain proposal

However, if I try to complete `Instant t = |`, then I do get the chain proposals.
Comment 1 Roland Grunberg CLA 2020-10-05 10:41:38 EDT
I suspect what's happening here from when I debugged in ChainCompletionProposalComputer is that the completion context doesn't know the return type when there is no token between the brackets (eg '(|) ). The moment a token exist, chain completion will attempt to look up possible candidates.

The AST parsing might treat it as a no-arg method, which might point to this being a jdt.core issue. Will have to investigate further.
Comment 2 Julian Honnen CLA 2020-10-07 02:49:24 EDT
this would probably also solve bug 207483?
Comment 3 Mickael Istria CLA 2020-12-12 17:16:07 EST
(In reply to Roland Grunberg from comment #1)
> The AST parsing might treat it as a no-arg method, which might point to this
> being a jdt.core issue. Will have to investigate further.

Did you have the opportunity to look at it? Can this be captured by some unit test (eg get the AST for a class and verify the method binds to correct candidates in AST or whatever?
Comment 4 Mickael Istria CLA 2021-11-15 04:22:00 EST
@Gayan: Wasn't it partly addressed recently? I seem to recall a related change, but I tried locally and this particular case is not fixed.
Comment 5 Gayan Perera CLA 2021-11-15 12:11:12 EST
(In reply to Mickael Istria from comment #4)
> @Gayan: Wasn't it partly addressed recently? I seem to recall a related
> change, but I tried locally and this particular case is not fixed.

The argument types are not provided in the completion context. But we need to debug why chain completions is not suggesting static method from the class.
Comment 6 Kalyan Prasad Tatavarthi CLA 2022-01-19 03:31:08 EST
@Gayan ,  Would you be able to have a look.
Comment 7 Gayan Perera CLA 2022-01-20 13:32:40 EST
@Kalyan sure i can have a look in next week
Comment 8 Mickael Istria CLA 2023-02-24 03:36:48 EST
Related discussion: https://github.com/eclipse-jdt/eclipse.jdt.core/discussions/780