1
0
mirror of https://github.com/golang/go synced 2024-11-18 19:44:46 -07:00
go/internal/lsp/testdata/folding
Suzy Mueller 93dcc2f048 internal/lsp: fold contained lines when lineFoldingOnly
Folding ranges need to be computed to present folding ranges that make
sense when lineFoldingOnly is true. This change computes the folding
ranges to include the lines that are contained within the start and end
parenthesis/braces when applicable.

Folding ranges are not returned when the contained nodes begin or end on
the same lines as the parenthesis/brace. This is to avoid misleading
folding ranges like the following in unformatted code:

if true {
	fmt.Println("true") } else {
	fmt.Println("false")
}
---folding "if true {}"--->
if true {
	fmt.Println("false")
}

Change-Id: I2931d02837ad5f2dd96cc93da5ede59afd6bcdce
Reviewed-on: https://go-review.googlesource.com/c/tools/+/192678
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-09-05 23:56:50 +00:00
..
a.go internal/lsp: fold contained lines when lineFoldingOnly 2019-09-05 23:56:50 +00:00
a.go.golden internal/lsp: fold contained lines when lineFoldingOnly 2019-09-05 23:56:50 +00:00
bad.go.golden internal/lsp: fold contained lines when lineFoldingOnly 2019-09-05 23:56:50 +00:00
bad.go.in internal/lsp: fold contained lines when lineFoldingOnly 2019-09-05 23:56:50 +00:00