1
0
mirror of https://github.com/golang/go synced 2024-10-01 04:08:32 -06:00
go/internal/lsp/source
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
..
analysis.go go/analysis: handle common nil pointers 2019-08-24 21:01:00 +00:00
completion_format.go internal/lsp: turn on completion documentation by default 2019-09-05 03:53:08 +00:00
completion_snippet.go internal/lsp: provide deep completion candidates 2019-06-27 18:58:03 +00:00
completion.go internal/lsp: turn on completion documentation by default 2019-09-05 03:53:08 +00:00
deep_completion.go internal/lsp: limit deep completion search scope 2019-08-27 20:50:25 +00:00
diagnostics_test.go internal/span: change URI.Filename so it just returns the filename 2019-06-10 21:39:43 +00:00
diagnostics.go internal/lsp: abstract the diff library so it can be substituted 2019-08-20 03:37:07 +00:00
enums.go internal/lsp: switch completion item tests to using the enum strings 2019-04-17 17:57:43 +00:00
folding_range.go internal/lsp: fold contained lines when lineFoldingOnly 2019-09-05 23:56:50 +00:00
format.go internal/lsp: use protocol.Range in completion items 2019-08-20 20:57:17 +00:00
highlight.go internal/lsp: split the telemetry library out 2019-08-15 21:28:02 +00:00
hover.go internal/lsp: use protocol.Ranges for source.Identifier 2019-08-29 05:14:58 +00:00
identifier.go internal/lsp: add prepare rename support 2019-08-29 20:19:46 +00:00
imports_test.go internal/lsp: abstract the diff library so it can be substituted 2019-08-20 03:37:07 +00:00
imports.go internal/lsp: abstract the diff library so it can be substituted 2019-08-20 03:37:07 +00:00
references.go internal/lsp: fix declarations in references 2019-09-05 03:51:44 +00:00
rename_check.go internal/lsp: use memoize package to cache source.Packages 2019-08-13 21:41:43 +00:00
rename.go internal/lsp: add prepare rename support 2019-08-29 20:19:46 +00:00
signature_help.go internal/lsp: use protocol.Ranges for source.Identifier 2019-08-29 05:14:58 +00:00
source_test.go internal/lsp: fold contained lines when lineFoldingOnly 2019-09-05 23:56:50 +00:00
suggested_fix.go internal/lsp: abstract the diff library so it can be substituted 2019-08-20 03:37:07 +00:00
symbols.go internal/lsp: split the telemetry library out 2019-08-15 21:28:02 +00:00
util.go internal/lsp: use protocol.Ranges for source.Identifier 2019-08-29 05:14:58 +00:00
view.go internal/lsp: use protocol.Ranges for source.Identifier 2019-08-29 05:14:58 +00:00