Suggested QuickFix - Split Long String

It would be nice to have a quickFix that works on strings that splits the string at the cursor position. It would look at the start of the string to see if it starts with " or @", then adds a close quote and + on the current line, and then moves the rest of the string to the next line and starts with the same quote style.

e.g.


becomes


3 comments
Comment actions Permalink

Wade Hatler wrote:

It would be nice to have a quickFix that works on strings that splits the string at the cursor position. It would look at the start of the string to see if it starts with " or @", then adds a close quote and + on the current line, and then moves the rest of the string to the next line and starts with the same quote style.

e.g.



becomes

 @"that wraps out of the window"]]>



-1

Strings that big belong out in a resource file anyway. (maybe a quickfix
for 'extract to resource' would be good though!)

Jonathan Choy

0
Comment actions Permalink

Sometimes they belong in a resource file and sometimes they don't. I do lots of text processing and code generation, so this mostly comes up with long Regular Expressons, and that sort of thing, because I put long UI visible strings in resource files to start with.

I do really like your 'Extract to Resource' ideal though, and if I had to choose one over the other I'd probably go with Extract to Resource.

0
Comment actions Permalink

Hello Wade,

I think this may make sense for a case of long regular expressions. The question
is how long should be the string for the context action (not a quick fix)
to suggest splitting it.
Clearly this should be configurable.

Please submit it to the tracker.


Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Sometimes they belong in a resource file and sometimes they don't. I
do lots of text processing and code generation, so this mostly comes
up with long Regular Expressons, and that sort of thing, because I put
long UI visible strings in resource files to start with.

I do really like your 'Extract to Resource' ideal though, and if I had
to choose one over the other I'd probably go with Extract to Resource.



0

Please sign in to leave a comment.