Repository: go
Issue: x/tools/gopls: add an option to keep original line breaks in documentation comments
Labels: NeedsDecision,FeatureRequest,gopls,Tools

<!--
Please answer these questions before submitting your issue. Thanks!
For questions please use one of our forums: https://github.com/golang/go/wiki/Questions
-->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.16 linux/amd64
</pre>

```
$ gopls version
golang.org/x/tools/gopls v0.6.6
```

### Does this issue reproduce with the latest release?

Yes

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="~/.cache/go-build"
GOENV="~/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="~/tools/go/path/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="~/tools/go/path"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1390191991=/tmp/go-build -gno-record-gcc-switches"

</pre></details>

### What did you do?

<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
-->

This is follow-up on [issue for vscode-go](https://github.com/golang/vscode-go/issues/1248) which turned out to be an issue with gopls.

Documentation comments inside code look like this:
<img width="512" alt="2021-02-25 18 13 16" src="https://user-images.githubusercontent.com/1712806/109175770-32bdd200-7797-11eb-95b0-05e57c227a2b.png">

It has line breaks so when you read comments while skimming yours or other peoples' code, you can expect comfortable and consistent text width. Comment width does not depend on viewport size, window size, font weight or system DPI.  

Hover tooltips, however, changes its width and sometimes you may get very long documentation and sometimes it's too narrow.

In aforementioned issue, vscode-go developer stated that this behaviour is intended to make docs look like godoc html representation.  
While it might sound like a good idea, it must be noted that godoc viewed inside browser as dedicated page.  
Which means that:
 - you get consistent width for every documentation within a page
 - you get a look at documentation only
 - godoc presents documentation for package as a whole, not for single function at a time
 - author may change content layout using css to make width consistent and convenient to consume
 - you may change content layout using stylus and alike to make content look convenient for yourself

Consumption behaviour inside text editor differs from godoc.  
It is easier to read short snippets when they narrow. There also was a link to upstream issue of vscode for making tooltip width that mitigates this issue.  
However,  while it solves _this_ issue, there is another one. Code of the package still remains important source of truth when you want to figure out why it works how it works. That means representation of docs becomes inconsistent: while you see continuous line in tooltip, it still narrow multi-line text in comments.

### What did you expect to see?

Documentation with predictable text size that looks like documentation inside code comments which code author originally wrote.

### What did you see instead?

<img width="512" alt="2021-02-25 18 13 30" src="https://user-images.githubusercontent.com/1712806/109175800-394c4980-7797-11eb-9209-39d1d5ba7a70.png">