Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315909 - [extract constant][quick assist] Extract to constant should be available anywhere in a string/number
Summary: [extract constant][quick assist] Extract to constant should be available anyw...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.7 M1   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-06 14:32 EDT by Aaron Digulla CLA
Modified: 2010-09-09 15:05 EDT (History)
3 users (show)

See Also:


Attachments
Fix (11.51 KB, patch)
2010-06-15 08:51 EDT, Markus Keller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Digulla CLA 2010-06-06 14:32:10 EDT
Build Identifier: I20100527-1700

Currently, you have to select the whole string (including quotes) to enable "Extract to constant" in the quick fix menu. It would be nice if Eclipse would simply select the constant I'm in when I press Ctrl+1 inside of a string or number.

Reproducible: Always
Comment 1 Dani Megert CLA 2010-06-07 08:20:58 EDT
Agree.

As a workaround you can use Alt+Shift+Up_Arrow to make the selection.
Comment 2 Markus Keller CLA 2010-06-15 08:51:57 EDT
Created attachment 171921 [details]
Fix

The Extract Constant and Extract Local Variable refactorings already work on the enclosing (or adjacent) expression. Made the quick assists behave the same.
Comment 3 Markus Keller CLA 2010-06-15 08:52:14 EDT
Fixed in HEAD.
Comment 4 Deepak Azad CLA 2010-08-03 07:28:36 EDT
Verified with I20100802-1800 on Ubuntu.
Comment 5 Markus Keller CLA 2010-09-09 15:05:25 EDT
For 3.7 M2, I've released an additional fix to QuickAssistProcessor that drops the relevance of these proposals when the selection is empty.