-
Notifications
You must be signed in to change notification settings - Fork 340
Description
I use the following method to quickly and easily comment out code blocks:
/*/
code();
// */Adding a single * on the first line uncomments the code block, so you can toggle the code block with a single character:
/**/
code();
// */You can also toggle between 2 different code blocks with a single character, if you add * to the first line here:
/*/
code("A");
/*/
code("B");
// */The same works in all languages that use /* */ for multiline comments (the C "family", JavaScript, JSON with comments, and a similar thing even works in Lua). Dart is a bit weird in that it requires the space in // */ or the code will fail to compile, but that's a "bug" in Dart, not in this package.
However, a recent change in this package (maybe related to #1498) breaks syntax highlighting.
The last line (// */) seems to be treated as a one line comment, and the end of the multiline comment is ignored, so the rest of the file is highlighted as a comment:

If there's a later */ (not part of another comment), the comment highlighting stops there, but it's (correctly) marked as a syntax error:

The same bug also occurs with a simple /* // */ (the rest of the file is highlighted as a comment):

This is a relatively recent change, I remember the highlighting working correctly about a week ago (but of course, that may depend on when I updated this package).