Rewrap icon indicating copy to clipboard operation
Rewrap copied to clipboard

rewrap breaks Go 1.19 go comment links

Open thediveo opened this issue 3 years ago • 0 comments

  • today's stable VSCode 1.67.2 and Rewrap v1.16.3 add-on.
  • Go 1.19beta1 installed.
  • gofmt and gopls updated to their latest and compiled with Go 1.19beta1.

Upcoming Go 1.19 adds support for URL links in the form of

See [frobatz release] for details. Or [blafasel].

[frobatz release]: https://frobatz.scam
[blafasel]: ...

Please see also https://tip.golang.org/doc/comment.

When saving a go source file, gofmt starting from 1.19 automatically collects all URLs and moves them to the end of a comment area. It puts the individual [Text]: URL onto separate lines, but without any empty lines in between.

Rewrapping such documents or comments will combine multiple URLs into a single paragraph, thereby destroying them.

In Go files, rewrap should never rewrap comment lines in the new Go comment form [text]: URL on single lines, but keep them as is/before.

thediveo avatar Jun 26 '22 19:06 thediveo