Bug 352625 - [quick assist] Don't show 'Inline local variable' quick assist if the variable is not used
Summary: [quick assist] Don't show 'Inline local variable' quick assist if the variabl...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-20 12:17 EDT by Curtis Windatt CLA
Modified: 2023-01-16 03:15 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis Windatt CLA 2011-07-20 12:17:29 EDT
1) Define a local variable such as 'int a = 10'
2) Note warning that variable is not used
3) Select the 'inline local variable' quick fix
Result
The variable is deleted

Marking as minor as there isn't anything better the quick fix can do.  However, it feels like the quick fix should not be offered in this case (there is already a quick fix available to remove the variable).
Comment 1 Dani Megert CLA 2011-07-21 03:09:49 EDT
You probably selected "a" first which gives you the mentioned Quick ASSIST.  If you really see this when hovering over the warning or invoking Ctrl+1 without anything selected then please reopen with a complete example.
Comment 2 Curtis Windatt CLA 2011-07-21 09:21:42 EDT
Two comments:

1) I was suggesting that the quickfix should not be shown when variable is selected as the quick fix simply deletes the line which the user may find confusing.  They may also think they have selected the wrong quick fix as the quick fix to remove the variable is only two choices up.

2) Hovering over the warning does not suggest that quick fix, but clicking on the warning icon in the ruler does suggest the quick fix (likely because it selects the text the warning is on, aka the variable 'a').
Comment 3 Dani Megert CLA 2011-07-25 06:41:52 EDT
.
Comment 4 Eclipse Genie CLA 2020-06-11 16:52:36 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 5 Eclipse Genie CLA 2023-01-16 03:15:39 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.