Bug 560700 - [feature] Support for completing multiple lines with content assist in column or multi selection mode
Summary: [feature] Support for completing multiple lines with content assist in column...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.15   Edit
Hardware: All All
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2020-03-02 13:07 EST by Gayan Perera CLA
Modified: 2024-02-27 00:15 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gayan Perera CLA 2020-03-02 13:07:29 EST
Let say we have a code block as below

ArrayList list1;
ArrayList list2;
ArrayList list3;
 
Now i would like to go into column selection mode and select the "ArrayList" column spanning the 3 lines and do a content assist and replace it with "Set". So the code will be as follows

Set list1;
Set list2;
Set list3;
 

This is supported in vscode. I would like to see the same in Eclipse IDE. I would think this is a important feature since many IDEs and Editors supports this.
Comment 1 Gayan Perera CLA 2020-03-02 13:29:22 EST
Actually this some what works if i remove the selected text from column selection and then try to auto complete. Like follows

ArrayList list1;
ArrayList list2;
ArrayList list3;

After removing text in column selection mode

| list1;
| list2;
| list3;

They select "Set" from content assist will give me the following.

Set list1;
Set list2;
Set list3;


It would be nice if we can give the same for replacements as well in column mode.
Comment 2 Eclipse Genie CLA 2022-02-21 12:42:11 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.
Comment 3 Dirk Steinkamp CLA 2022-03-04 18:03:59 EST
This should resolve the described use case: https://bugs.eclipse.org/bugs/show_bug.cgi?id=576377
Comment 4 Mickael Istria CLA 2022-03-05 02:00:08 EST
(In reply to Dirk Steinkamp from comment #3)
> This should resolve the described use case:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=576377

The text manipulation os not enough here, the tricky part becomes to compute the relevant completion items with multiple requests and to merge/filter them.
Comment 5 Dirk Steinkamp CLA 2022-03-05 03:33:42 EST
(In reply to Mickael Istria from comment #4)
> (In reply to Dirk Steinkamp from comment #3)
> > This should resolve the described use case:
> > https://bugs.eclipse.org/bugs/show_bug.cgi?id=576377
> 
> The text manipulation os not enough here, the tricky part becomes to compute
> the relevant completion items with multiple requests and to merge/filter
> them.

I just tried it out: Actually the problem does not to seem to be to generate completion items in general (that somewhat works and seems to be based on the first caret), but the insertion of the selected proposal doesn't respect multi-selection (or block selection ...), but just inserts the code completion at the first caret position and ends multi-selection mode.


A little more detail to the "somewhat" in the provided example:

1. if a multi-selection or block selection is active and I newly type the first letters of an identifier, I get an adequate content assist.

2. if the selection already contains some characters, and I invoke content assist, then I don't get proper suggestions. Actually I don't get a proper suggestion if I only have a single selection either --- might this be intended behavior, and I just don't understand the pattern of the proposals?!?
Comment 6 Eclipse Genie CLA 2024-02-27 00:15:19 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.