Embedded code blocks need to finish evaluating their own code blocks (such as { } in C#) before control is handed back to the parent block. This results in broken syntax highlighting for the rest of the document when embedded C# code doesn't close all brackets it opens before the T4 end tag (#>). For more information, see microsoft/vscode#20488
2 possible solutions: Write our own, custom C# highlighter that takes #> into account for each code block, or wait and see if the VS Code team fixes the issue linked above.