dotnet/roslyn

One missing closing bracket creates dozens of errors

Open

#24,028 opened on Jan 4, 2018

View on GitHub
 (1 comment) (0 reactions) (0 assignees)C# (20,414 stars) (4,257 forks)batch import
Area-CompilersBugConcept-Diagnostic ClarityDeveloper CommunityLanguage-VBhelp wanted

Description

Say I type the following:

MessageBox.Show("test

Now a huge list of errors will appear in the error list and all code below the above line is marked in red.

Of course, the closing bracket is still missing, but that should only create one error in the list, not dozens, and dozens of wavy red underlines.

However, on my PC all code below the above line is marked in red and most of the code (but not all) has wavy red lines underneath.

This issue has been moved from https://developercommunity.visualstudio.com/content/problem/157014/one-missing-closing-bracket-creates-dozens-of-erro.html VSTS ticketId: 530270 These are the original issue comments:

Agustin Paroli on ‎11‎/‎28‎/‎2017, 02:57 PM (36 days ago): When you forget to put a parenthesis (and also a quote, as in your example), the compiler interprets all the code that follows it as if it should be inside the parenthesis, and as what you put inside the parentheses is not valid in that method / object, many errors will be shown depending on the code that continues it. It is not a bug, it is the normal and expected behavior of the IDE.

Marc Enzler on ‎11‎/‎29‎/‎2017, 02:17 AM (35 days ago): Dear Augustin,Thank you for your reply. I need to clarifiy: it is not the missing closing bracket that causes the errors but the missing closing quote.If I type: MessageBox.Show("the moment I enter the quote dozens of errors appear in the error list and everything below this line gets red. It is very confusing and distracts me massively. After all, I am still typing so it's obvious the statement is uncomplete.Please note that I am using Visual Basic, not Java, and in Visual Basic semantics only this one line contains an error, all other lines are perfectly sound.I have now checked with my VS2012 installation which I have been using until a few weeks ago, and there the behavior is differently and as I would expect, no error is show as long as I do not move the focus away from the incomplete line and when I do only one error is shown indicating there is something missing on that line.If this is not a bug, where might I change this behavior of the error list? It is extremely annoying.Thanks!

Jinu Joseph [MSFT] on ‎12‎/‎3‎/‎2017, 05:02 AM (31 days ago): We appreciate you taking the time to report this problem. We are currently prioritizing problems that are impacting a broad set of our customers, so we may not be able to investigate this one immediately. We know this problem is important to you, so we will continue to monitor it.

These are the original issue solutions: (no solutions)

Contributor guide