0

Lets say I have this VB.net code in VS2013:

Y = "This is a test of some text."
Z = "And this is another line of text where its longer."

Now I realize I it would be useful to output my loop iterator in Y, so I click in Y and start typing...

Y = "This is a test of some text on "."
Z = "And this is another line of text where its longer."

Now since I don't have a closing quote, VS interprets this as the string (and as you can see from the coloring here in SO, so does the MU parser!)...

Y = "This is a test of some text on " &." Z = "

Which means that Y and Z are "open" strings. Now I complete typing, and VS does this...

Y = "This is a test of some text on " & i & "."
Z = "And this Is another line Of text Where its longer."

Since strings like "is", "where" and "and" are Linq keywords, VS happily "fixes" the camel casing for me. It does this right to the end of the function, which may cause dozens of lines to be fubared.

Please tell me there is an easy way to fix this?

UPDATED: the actual example

Maury Markowitz
  • 9,082
  • 11
  • 46
  • 98
  • 1
    would this help? http://stackoverflow.com/questions/737222/turn-off-auto-formatting-in-visual-studio OR it could also be under "Tools->Options->Text Editor->HTML->Miscellaneous" – BobNoobGuy Jun 28 '16 at 18:58
  • That appears to turn them all off, which isn't what I'm looking for. – Maury Markowitz Jun 28 '16 at 19:39
  • Ok, this flag does NOT fix the problem. – Maury Markowitz Jun 28 '16 at 20:07
  • 1
    I'm not sure how this is a problem. VS2013 automatically types in the closing quote when you type the opening one. The correct fix is to not remove it after VS added it(?). – Drunken Code Monkey Jun 28 '16 at 19:25
  • Perhaps this example will trigger it... click in the middle of the string and type a quote, because ultimately you're trying to add `" & i & "' to the string. – Maury Markowitz Jun 28 '16 at 19:34
  • I did try every which way to reproduce the issue, it simply does not ever occur. Text is not automatically reformatted until you change line in the editor, and it is not automatically reformatted so long as the line doesn't pass basic syntax checking. – Drunken Code Monkey Jun 28 '16 at 19:39
  • Don't know what to say, looking through my code I have dozens of examples. Every time I do a checkin I see a bunch more have been changed and have to go fix them again. – Maury Markowitz Jun 28 '16 at 19:41
  • Are you using any kind of third party refactoring product, like Resharper, CodeRush, JustCode, or StyleCop? Is is possible the adjustment is made from a third party addin? – Drunken Code Monkey Jun 28 '16 at 19:45
  • No. And ironically, while editing the message above and ensuring that it did indeed cause the problem, I found dozens of new ones like " A recovery In C66 has a StopPSF type which we Do Not support. Defaulting." I did not ever type capitals on "In", "Do" or "Not". Again, notice these are always Linq keywords. – Maury Markowitz Jun 28 '16 at 20:02
  • Just triggered it again. While typing in a new error message I fat fingered a key, and when I tried to hit backspace to remove it, I fat fingered Delete. That deleted the close-quote, and BLAM! – Maury Markowitz Jun 28 '16 at 20:05
  • I would recommend you try a fresh install on a different machine, without any third party tools installed, and see if you still have the issue when editing your project there. I am 100% unable to reproduce your issue. – Drunken Code Monkey Jun 28 '16 at 20:25
  • Ok tried it on my Mac using Parallels. Same thing. – Maury Markowitz Jun 29 '16 at 11:26

0 Answers0