Syntax highlighter breaks for the following code:
// The entire block below should be commented out
/*
operation = ''
print("Pick an operation: +-*/")
// Get user input here
*/
In this code, the comment appears to be closed by the */ in the print line, so this becomes invalid code:

It looks like the comment is ending at the correct location - the same place the analyzer considers the end of the comment and starts to report other errors?
Logically, shouldn't */ inside the print be treated as a string instead of end of comment?
Whereas the last line should be treated as end of comment.
Logically, shouldn't
*/inside the
Whereas the last line should be treated as end of comment.
I don't think so. Comments are usually text, not code. The parser has no business trying to parse code inside them. Trying to do so raises many questions (like what to do when it's invalid, and how to recover). You shouldn't need to balance quotes (and parens, brackets, etc.) inside comments in order to get correct parsing.
Dart (unlike many languages) does support nesting comment blocks, so this works:
/*
This is a comment /* and this is a nested comment */
*/
Whereas in most languages the second /* is ignored (it's inside a comment!) and the first */ closes the original comment, making the second */ invalid. This works out nice if you want comment out a block that already contains block comments.
I think this case is just unfortunate that you tried to block-comment something that had an end-of-block-comment marker in it that wasn't really an end-of-block-comment.
Apparently GitHub's Dart syntax highlighting doesn't handle nested comments correctly 😄
I'll close this since as far as I can see, it's working as intended. The VS Code plugin has no influence over the language, so all it can do here is ensure the code is highlighted as the spec dictates - any language changes are handled in Dart (https://github.com/dart-lang/language).
Thanks for the detailed answer @DanTup !
Apparently GitHub's Dart syntax highlighting doesn't handle nested comments correctly 😄
Github uses dart-atom/dart to render dart syntax in markdown.
Yeah, that was my understanding too (and I found https://github.com/github/linguist/blob/master/.gitmodules#L335-L337). However Dart Code's highlighting was based on Atom's, so I'm fairly sure it handles nested comments, so it's strange to see the above fail 🤷♂️