Bug 430469 - [refactoring][extract constant] Extract constant should expand the selection to include the " if possible
Summary: [refactoring][extract constant] Extract constant should expand the selection ...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-16 06:54 EDT by Lars Vogel CLA
Modified: 2014-03-16 22:27 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2014-03-16 06:54:14 EDT
If I double-click on the String constant it gets selected but Refactor -> Extract constant does not allow to create a constant from it, as it requires that the " is also selected.

Would it be possible to automatically extend the selection? If yes, can you point me to an existing example how this can be done, I would like to try to provide a patch for this bug report.
Comment 1 Martin Mathew CLA 2014-03-16 22:27:58 EDT
Currently if user invoke Ctrl+1 and select "Extract Constant" inside a String literal without making any selection, then "Extract Constant" quick assist will expand the selection and perform the necessary refactoring. Check bug 315909 and the fix to understand how it is done.