2 ms·
> How do you indent block comments? Do they stay untouched? Block comments are a little tricky and there are a handful of heuristics to handle them. Generally
by munificent 7y ago
> How do you indent block comments? Do they stay untouched?
Block comments are a little tricky and there are a handful of heuristics to handle them. Generally they stick to the preceding token. Block comments are rarely used in Dart and when they are, it's often just a small marker to describe the previous element like:
foo(null /* missing */, blah);
So adhering it to the previous token usually does the right thing.
> If so, what to do if there are already indents in the comment?
It doesn't touch the body of the comment itself. There's too many ways for that to go wrong given all of the various things a human might choose to stuff in there: ASCII art, tables, prose, etc.