5

Let's say you have a module that's several hundreds of lines long. At the very top of your code file, you go to start up a string, so you type a quote. Total wreckage ensues as the string remains unterminated for a time, causing everything within your entire code file to be subject to erratic encapsulation by your string (see image for actual example of all the errors generated). No big deal, right? You just finish your string and all the errors will go away. While true, you may find the IDE has had its way with other strings in your document. For example, these lines...

oLog.writeLogFile("Starting System Update and Version Update ")
oLog.writeLogFile("Starting Script for Fetching Data from Source to Dest")

...get changed to this:

oLog.writeLogFile("Starting System Update And Version Update ")
oLog.writeLogFile("Starting Script For Fetching Data from Source To Dest")

Notice how and changes to And, for to For, and to to To. What's happening here is that, as other strings in the document become... eh... "destrung"... so some of the words that were once part of a string are now interpreted as keywords by the IDE. Because it's VB, it modifies capitalization automatically. When you finally terminate your string, all the other strings further down in the document become properly terminated as well, but the jarring effects still remain.

Is there a way to prevent this from occurring?

enter image description here

oscilatingcretin
  • 10,457
  • 39
  • 119
  • 206
  • Wow. That really sucks. Related : http://stackoverflow.com/q/38033078/327083 – J... Jul 13 '16 at 13:02
  • also related : http://stackoverflow.com/q/33181836/327083 – J... Jul 13 '16 at 13:04
  • One suggestion from the above link was *"There is an option (Tools Menu->Options) under "Text Editor->Basic->General" called "Automatic brace completion". If this option is not selected, the closing quote will not be automatically inserted."* – J... Jul 13 '16 at 13:15
  • 3
    The Roslyn integration in VS2015 has caused a very large number of problems like this. I cannot repro this specific issue, do be sure to apply at least Update 2. If you have a good example that still causes havoc like this with Update 3 then be sure to click the [New Issue button](https://github.com/dotnet/roslyn/issues). – Hans Passant Jul 13 '16 at 13:17

1 Answers1

1

Why not first type a double ", then return in between them and start typing your string? I do it all the time to prevent this. I find that the short delay in between typing your first " and the moment the IDE starts capitalizing keywords is long enough for me to (remember to) type the second ".