Literal string constants and auto-closing quotes

This problem popped up in earlier versions, was quashed, and now it's back
in 6.0 again.

If you're typing along and type a constant literal string (prefixed with "@"
symbol), you get an extraneous quote, as seen below (where I typed
everything up to the first double-quote, and the | indicates where the
cursor is):

private const string myLiteralString = @"|""

This necessitates that I always have to delete one of the extra quotes.
This is 100% reproducible on my system, even after rebooting, ever since I
upgraded to the 6.0 release.

I have VSCommands 2010 and PowerCommands for VS2010 plugins, in addition to
ReSharper.




7 comments

This also happens if you attempt to insert a quote in a statement that
already contains one or more quotes; e.g.

if(this == "that")

and you attempt to add that == "this" || you get

if(that == "this"" || this == "that")

I've also seen ReSharper randomly insert two double quotes just for fun,
such as when I pasted a javascript regex pattern in the form /blah/ and then
tried to replace the slashes with quotes I got something like ""/blah" or
""lah".

"Paul Bradshaw"  wrote in message
news:j19idu$95j$1@nntp-server.labs.intellij.net...

This problem popped up in earlier versions, was quashed, and now it's back
in 6.0 again.

If you're typing along and type a constant literal string (prefixed with "@"
symbol), you get an extraneous quote, as seen below (where I typed
everything up to the first double-quote, and the | indicates where the
cursor is):

private const string myLiteralString = @"|""

This necessitates that I always have to delete one of the extra quotes.
This is 100% reproducible on my system, even after rebooting, ever since I
upgraded to the 6.0 release.

I have VSCommands 2010 and PowerCommands for VS2010 plugins, in addition to
ReSharper.



0

I guess the question now is... is jetbrains aware of this, and is it slated
for fixing in 6.1?


"Greg Law"  wrote in message
news:j261re$chl$1@nntp-server.labs.intellij.net...

This also happens if you attempt to insert a quote in a statement that
already contains one or more quotes; e.g.

if(this == "that")

and you attempt to add that == "this" || you get

if(that == "this"" || this == "that")

I've also seen ReSharper randomly insert two double quotes just for fun,
such as when I pasted a javascript regex pattern in the form /blah/ and then
tried to replace the slashes with quotes I got something like ""/blah" or
""lah".

"Paul Bradshaw"  wrote in message
news:j19idu$95j$1@nntp-server.labs.intellij.net...

This problem popped up in earlier versions, was quashed, and now it's back
in 6.0 again.

If you're typing along and type a constant literal string (prefixed with "@"
symbol), you get an extraneous quote, as seen below (where I typed
everything up to the first double-quote, and the | indicates where the
cursor is):

private const string myLiteralString = @"|""

This necessitates that I always have to delete one of the extra quotes.
This is 100% reproducible on my system, even after rebooting, ever since I
upgraded to the 6.0 release.

I have VSCommands 2010 and PowerCommands for VS2010 plugins, in addition to
ReSharper.


0

This is still an issue for me in 6.1.1 ... is this ever going to be
addressed?  It was fixed once in 5.0, but now it's broken again... it seems
like a regression like this should have been caught, or at the very least,
should have been fixed in the bug-fix update.

Is there going to be another bug-fix update for 6.x?


"Paul Bradshaw"  wrote in message
news:j19idu$95j$1@nntp-server.labs.intellij.net...

This problem popped up in earlier versions, was quashed, and now it's back
in 6.0 again.

If you're typing along and type a constant literal string (prefixed with "@"
symbol), you get an extraneous quote, as seen below (where I typed
everything up to the first double-quote, and the | indicates where the
cursor is):

private const string myLiteralString = @"|""

This necessitates that I always have to delete one of the extra quotes.
This is 100% reproducible on my system, even after rebooting, ever since I
upgraded to the 6.0 release.

I have VSCommands 2010 and PowerCommands for VS2010 plugins, in addition to
ReSharper.



0

PaulB wrote:

Is there going to be another bug-fix update for 6.x?


Doesn't look like it:
http://devnet.jetbrains.net/thread/434967

Andrey Serebryansky wrote:

We did our best to fix the most critical and outstanding bugs as well as provided some new features.

0

Hi.

Are you sure this is a error in Resharper?
Have you disabled vscommands and the power tools and have the same issue?

I ask this because the power tools have a feature called Auto Brace Completion. This adds automatically bracers and also quotes and perhaps they are not working together with resharper auto complete so you should disable this feature from the power commands anyway.
Well this is what I did and I don't have your mentioned issues.

Kind regards,
Sven

0

Thanks for the pointer.  That did indeed fix one part of the problem... it
no longer creates three quotes in a row.  I will say it's interesting that
the problem was ONLY with Literal strings prefixed by an "@" ... braces and
simple quotes worked fine.

HOWEVER:  A problem still remains in that after typing the @ and the first
double quote, giving me the expected closing quote with the cursor in
between the two quotes... typing another quote results in a THIRD quote
being added, rather than "typing over" the second quote as would be
expected.

So it's closer.  It's better.  But there's still something broken.



"Sven Heitmann"  wrote in message
news:15521616.120491334587223288.JavaMail.devnet@confluence.jetbrains.net...

Hi.

Are you sure this is a error in Resharper?
Have you disabled vscommands and the power tools and have the same issue?

I ask this because the power tools have a feature called *Auto Brace
Completion*. This adds automatically bracers and also quotes and perhaps
they are not working together with resharper auto complete so you should
disabled them anyway.
Well this is what I did and I don't have your mentioned issues.

Kind regards,
Sven

---
Original message URL: http://devnet.jetbrains.net/message/5457153#5457153

0

Well I guess as a verbatim string can contain " it is in that case not recognized as "end marker" but as "content" as you could write

const string test = @"""Test""";

to get "Test" and in that case you would have "much trouble" to enter this otherwise.
So for me it was a design desicion which seems ok.

The question is why do you use a verbatim string and if this is really necessary always?
I guess you write something and want to "jump" via " to the end of the string to set ; or do other string stuff. You could also use the arrow key for this.

0

Please sign in to leave a comment.