Rather pointless lightbulb suggestion.

I'm not sure if I've asked this before but RS4 offers me a lightbulb suggestion to split the string below:

WriteTimeLine(_logFile, "----


Configuration file settings -
", _echo);


If I do as it suggests, it does the following to the statement:

WriteTimeLine(_logFile, "----
C" + "onfiguration file settings -
", _echo);


It's not exactly progress is it?

6 comments
Comment actions Permalink

Hello Peter Hamilton-Scott,

Light bulb is never a suggestion, it is there to tell you that ReSharper
can do something here. ReSharper's suggestions come in form of squiggly
underlines (or shot green underlines for hints). Consider "Invert if statement"
context action, you can do this infinitly, inverting it again and again,
essentially flipping between two forms. It is very useful action, but it
does not mean it is suggested just because you can invoke it.

Sincerely,
Ilya Ryzhenkov

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


P> I'm not sure if I've asked this before but RS4 offers me a lightbulb
P> suggestion to split the string below:
P>
P> *WriteTimeLine(_logFile, "----


Configuration file settings
P> -


", _echo);*
P>
P> If I do as it suggests, it does the following to the statement:
P>
P> *WriteTimeLine(_logFile, "----


C" + "onfiguration file settings
P> -


", _echo);*
P>
P> It's not exactly progress is it?
P>


0
Comment actions Permalink

Ilya,

Thanks for explaining that but I can't really see what advantage is to be gained from splitting the string. It's probably a good solution but I can't see what the problem is that it solves. I mean, if I have a long quoted string that is syntactically correct to the compiler then why would I want to split it? I don't think this is necessarily an RS4 'problem' but I can't quite see the 'why'.

0
Comment actions Permalink

Hello Peter,

One example would be when you want to introduce part of the string constant
as parameter.

Sincerely,
Ilya Ryzhenkov

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


IR> Ilya,
IR>
IR> Thanks for explaining that but I can't really see what advantage is
IR> to be gained from splitting the string. It's probably a good
IR> solution but I can't see what the problem is that it solves. I mean,
IR> if I have a long quoted string that is syntactically correct to the
IR> compiler then why would I want to split it? I don't think this is
IR> necessarily an RS4 'problem' but I can't quite see the 'why'.
IR>


0
Comment actions Permalink

Another would be to wrap the string onto multiple lines to respect your
maximum line width.

Mike

"Ilya Ryzhenkov" <orangy@jetbrains.com> wrote in message
news:76a2bd0b1566448ca7772b49e07a4@news.intellij.net...

Hello Peter,

>

One example would be when you want to introduce part of the string
constant as parameter.
Sincerely,
Ilya Ryzhenkov

>

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

>
>

IR> Ilya,
IR> IR> Thanks for explaining that but I can't really see what advantage
is
IR> to be gained from splitting the string. It's probably a good
IR> solution but I can't see what the problem is that it solves. I mean,
IR> if I have a long quoted string that is syntactically correct to the
IR> compiler then why would I want to split it? I don't think this is
IR> necessarily an RS4 'problem' but I can't quite see the 'why'.
IR>


0
Comment actions Permalink

Line width. That makes sense. I basically open my quotes and keep typing until I've finished. ;)

0
Comment actions Permalink

Another way I've used that is just to split the string, so I can add
additional information (like variables), and then another light-bulb pops up
to convert it to string.format instead of concatenation, and voila.


"Peter Hamilton-Scott" <no_reply@jetbrains.com> wrote in message
news:30267423.2591209410729082.JavaMail.jive@app4.labs.intellij.net...

Line width. That makes sense. I basically open my quotes and keep typing
until I've finished. ;)


0

Please sign in to leave a comment.