Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: CommentToMarkdown adds extra newlines when formatting code blocks #43257

Closed
hyangah opened this issue Dec 18, 2020 · 1 comment
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@hyangah
Copy link
Contributor

hyangah commented Dec 18, 2020

gopls version 0.6.1
go version go1.16beta1 darwin/amd64

hover over make shows

Screen Shot 2020-12-17 at 8 54 54 PM

Gopls trace:


[Trace - 20:54:39.323 PM] Received response 'textDocument/hover - (65)' in 0ms.
Result: {"contents":{"kind":"markdown","value":"```go\nfunc(t Type, size ...IntegerType) Type\n```\n\n[`make` on pkg.go.dev](https://pkg.go.dev/builtin?utm_source=gopls#make)\n\nThe make built\\-in function allocates and initializes an object of type\nslice, map, or chan \\(only\\)\\. Like new, the first argument is a type, not a\nvalue\\. Unlike new, make\\'s return type is the same as the type of its\nargument, not a pointer to it\\. The specification of the result depends on\nthe type\\:\n\n\n    Slice: The size specifies the length. The capacity of the slice is\n\n    equal to its length. A second integer argument may be provided to\n\n    specify a different capacity; it must be no smaller than the\n\n    length. For example, make([]int, 0, 10) allocates an underlying array\n\n    of size 10 and returns a slice of length 0 and capacity 10 that is\n\n    backed by this underlying array.\n\n    Map: An empty map is allocated with enough space to hold the\n\n    specified number of elements. The size may be omitted, in which case\n\n    a small starting size is allocated.\n\n    Channel: The channel's buffer is initialized with the specified\n\n    buffer capacity. If zero, or the size is omitted, the channel is\n\n    unbuffered.\n\n"},"range":{"start":{"line":31,"character":12},"end":{"line":31,"character":16}}}

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Dec 18, 2020
@gopherbot gopherbot added this to the Unreleased milestone Dec 18, 2020
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.6.2 Dec 18, 2020
@stamblerre stamblerre changed the title x/tools/gopls: extra new lines in some documentations x/tools/gopls: CommentToMarkdown adds extra newlines when formatting code blocks Dec 23, 2020
ShoshinNikita added a commit to ShoshinNikita/tools that referenced this issue Apr 6, 2021
This change simplifies the code and fixes the issue with
extra new lines. It also adds unit tests.

Fixes golang/go#43257
@gopherbot
Copy link

Change https://golang.org/cl/307709 mentions this issue: internal/lsp/source: refactor commentToMarkdown function

ShoshinNikita added a commit to ShoshinNikita/tools that referenced this issue May 12, 2021
This change simplifies the code and fixes the issue with
extra new lines. It also adds unit tests.

Fixes golang/go#43257
@golang golang locked and limited conversation to collaborators May 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants