Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332205 - [quick assist] [typing] Add quick assists to (un-) escape pasted string
Summary: [quick assist] [typing] Add quick assists to (un-) escape pasted string
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-09 08:35 EST by Deepak Azad CLA
Modified: 2011-08-03 10:48 EDT (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 Deepak Azad CLA 2010-12-09 08:35:01 EST
Now that Bug 328524 is fixed, we should offer similar functionality in the Java Editor as well.

1. Offer a 'Escape backslashes' quick fix for 'Invalid Escape Sequence' problem.
2. Remove the preference 'Escape text when pasting into a string literal', instead if escaping is required automatically show a popup with the above quick fix.
Comment 1 Markus Keller CLA 2010-12-09 08:53:11 EST
> 1. Offer a 'Escape backslashes' quick fix for 'Invalid Escape Sequence'
> problem.

We should also have quick assists that escape / unescape the selected or enclosing string or string part.

> 2. Remove the preference 'Escape text when pasting into a string literal',
> instead if escaping is required automatically show a popup with the above quick
> fix.

I don't think we should remove the preference now, since that would break people who are used to the current behavior. But we should offer the unescape quick assist when the preference is enabled and the pasted string was escaped.

Also note that escaping in the Java editor is not only about escaping backslashes, but also about adding line delimiters.
Comment 2 Deepak Azad CLA 2010-12-09 09:03:57 EST
(In reply to comment #1)
> I don't think we should remove the preference now, since that would break
> people who are used to the current behavior. But we should offer the unescape
> quick assist when the preference is enabled and the pasted string was escaped.
Fair enough.
Comment 3 Deepak Azad CLA 2010-12-30 14:49:29 EST
See also bug 268070 and bug 72869.