Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 332205

Summary: [quick assist] [typing] Add quick assists to (un-) escape pasted string
Product: [Eclipse Project] JDT Reporter: Deepak Azad <deepakazad>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, markus.kell.r
Version: 3.7   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

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.