Community
Participate
Working Groups
To avoid encoding problems, we prefer to keep our source code in ASCII. Especially when creating tests, it is often necessary non-ascii content in Strings. Manually encoding this using \uXXXX is very cumbersome. To make things easier, I propose adding an option that lets the "Escape text when pasting into a string literal"-Feature use Unicode escape syntax for all characters <32 or >127
New Gerrit change created: https://git.eclipse.org/r/92825
@Noopur, @Dani, is it OK if I add this feature?
(In reply to Till Brychcy from comment #2) > @Noopur, @Dani, is it OK if I add this feature? It will be OK for me to add this feature though I am not sure if it should be enabled by default. I quickly had a look at the Gerrit and noticed the following: - the Javadoc of the new constant EDITOR_ESCAPE_STRINGS_NON_ASCII should be fixed. - the new option should have a mnemonic. Please make sure to add a N&N entry for any relevant fix/feature that you add.
Gerrit change https://git.eclipse.org/r/92825 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=80371eef36debbd7dcb3ee20d5518acd4ea5e10d
(In reply to Noopur Gupta from comment #3) > (In reply to Till Brychcy from comment #2) > > @Noopur, @Dani, is it OK if I add this feature? > > It will be OK for me to add this feature though I am not sure if it should > be enabled by default. Done: Disabled by default > > I quickly had a look at the Gerrit and noticed the following: > - the Javadoc of the new constant EDITOR_ESCAPE_STRINGS_NON_ASCII should be > fixed. Done > - the new option should have a mnemonic. Done. > > Please make sure to add a N&N entry for any relevant fix/feature that you > add. Sure, will do that. (In reply to Eclipse Genie from comment #4) > Gerrit change https://git.eclipse.org/r/92825 was merged to [master]. > Commit: > http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/ > ?id=80371eef36debbd7dcb3ee20d5518acd4ea5e10d Released for 4.8M3
(In reply to Till Brychcy from comment #5) > > Please make sure to add a N&N entry for any relevant fix/feature that you > > add. > Sure, will do that. The N&N doc for M3 is available for additions. Closing the bug as the patch has been released.
New Gerrit change created: https://git.eclipse.org/r/110338
Gerrit change https://git.eclipse.org/r/110338 was merged to [master]. Commit: http://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=42bbda8e7471d042cface4a2d01cb0f133926dc3
Great feature, very useful! However, I noticed a small problem: The substitution is only performed if you paste more than one character -- a single pasted unicode character does not undergo the substitution due to the following length>1 check: https://git.eclipse.org/r/plugins/gitiles/jdt/eclipse.jdt.ui/+/refs/changes/25/92825/2/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaStringAutoIndentStrategy.java#199 Is this the intended behavior?
(In reply to Sebastian Ratz from comment #9) > Great feature, very useful! > > However, I noticed a small problem: > > The substitution is only performed if you paste more than one character -- a > single pasted unicode character does not undergo the substitution due to the > following length>1 check: > > https://git.eclipse.org/r/plugins/gitiles/jdt/eclipse.jdt.ui/+/refs/changes/ > 25/92825/2/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/ > JavaStringAutoIndentStrategy.java#199 Hmm I haven't touched that line, it is from Bug 395257. > > Is this the intended behavior? Not really, maybe this is was just an optimization. But this needs a bit of examination. As this bug is already resolved, can you please make a new one?
There is already bug 209976 which is essentially the same. The the non-ASCII escaping feature makes it more prominent. Should I create a new bug specific to non-ASCII escaping?
(In reply to Sebastian Ratz from comment #11) > There is already bug 209976 which is essentially the same. The the non-ASCII > escaping feature makes it more prominent. > > Should I create a new bug specific to non-ASCII escaping? No, thanks for finding this.