code_builder icon indicating copy to clipboard operation
code_builder copied to clipboard

Add support for comments - line and doc

Open kevmoo opened this issue 7 years ago • 4 comments

kevmoo avatar Jul 26 '18 20:07 kevmoo

Something to keep in mind for this one: supporting references in doc comments. For example, if I have:

import 'foo.dart' as _i1;

/// This class extends [Foo].
class Bar extends _i1.Foo {}

Then I get a "Only reference in scope identifiers in doc comments" lint report. If a first-class Doc comment could be made, I could add text ("This class extends ") and references (TypeReference(...)).

srawlins avatar Jan 13 '21 17:01 srawlins

@srawlins if you take another stab at this my wish list would be

  • Add line breaks to support formatting line lengths
  • Some markdown support, like adding a link to a URL
  • Example code block

donny-dont avatar Jun 24 '21 18:06 donny-dont

Good ideas. I don't foresee mailing a PR any time soon.

srawlins avatar Jun 30 '21 21:06 srawlins

https://github.com/dart-lang/code_builder/pull/389 implements a little bit of this - the ability to have line comments for libraries, emitted at the beginning of the file (// Generated by ...).

devoncarew avatar Dec 19 '22 23:12 devoncarew