Bug 562258 - When using the "Alt + /" smart code prompt to select a method, Eclipse inserts the current method body behavior by default, which will lead to the following situation, which is very frustrating: Please see the picture for the process description:
Summary: When using the "Alt + /" smart code prompt to select a method, Eclipse insert...
Status: CLOSED DUPLICATE of bug 562130
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.16   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 4.16 M3   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-17 07:37 EDT by xh z CLA
Modified: 2020-04-17 07:48 EDT (History)
1 user (show)

See Also:


Attachments
Process demo picture please see (140.71 KB, image/png)
2020-04-17 07:37 EDT, xh z CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description xh z CLA 2020-04-17 07:37:13 EDT
Created attachment 282499 [details]
Process demo picture please see

"Alt + /" smart code prompt to select a method, Eclipse inserts the current method body behavior by default, which will lead to the following situation, which is very frustrating:
Please see the picture for the process description:
Process demo picture please see

Can you see it? The previous method body still needs to be manually deleted, which is very troublesome in coding.
I don't know if this problem can be solved. If it can't be solved, please transfer it to the Eclipse IDE development team to solve it. What do you think?
Other IDEs replace the current method body by default, which is great. Can you understand what I mean by my description?
System: win10 enterprise x64
STS4: 4.6 x64
Memory: 8GB
Hard disk: 5400 rpm
JDK: 1.8
Preferences-> Java-> Editor-> Content-Assist can solve the problem of method name replacement, but the method body, method parameters and other content can not be replaced
Although the method can be replaced, the method body can not be replaced with the selected method body, you still need to manually delete the useless parameter content
Like, idea, visualstudio do not need to manually delete useless parameter content like this

I hope you or the Eclipse IDE team can solve this problem. thank you very much!

Finally, look at STS4's comments
kdvolder commented 3 days ago
If Martin's suggestions doesn't quite do what you want (and I agree personally that the 'overwrite' mode for completions in Eclipse isn't terribly useful) then It sounds like you have a valid complaint to me.

However, this behavior is inherited by STS from Eclipse JDT. STS doesn't directly control it.

If you have a good idea on how to improve this behavior then you could try raising a enhancement request as an Eclipse bugzilla ticket here: https://bugs.eclipse.org/bugs/

If you want to do this, try to be as precise as possible on what behavior you would like as opposed to what it does currently. If you explain it well then there is a decent chance that JDT developers will actually act on your suggestion and try to fix it.

martinlippert commented 2 days ago
@395053994 You are right, the params are not being deleted automatically, I can totally see your point here. I would suggest to raise this with Eclipse JDT via: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT - auto-selects the right project for this. You should select "UI" as the component then, since most of the auto-completion is implemented there.
Comment 1 Stephan Herrmann CLA 2020-04-17 07:48:59 EDT
Don't report the same problem twice, but read the comment I wrote on the first bug.

*** This bug has been marked as a duplicate of bug 562130 ***