1
0
mirror of https://github.com/golang/go synced 2024-11-19 05:54:44 -07:00
go/internal/lsp/testdata/folding/a.go.golden
Suzy Mueller be0da057c5 internal/lsp: return only multiline ranges when lineFoldingOnly
If the client registers with foldingRange.lineFoldingOnly = true, only
return folding ranges that span multiple lines. Do this as they are
computed, so that if other filtering is applied later, we do not include
ranges that would go unused by the client anyway.

Change-Id: I27ea24428d25f180e26892de0f6d16c211225bf7
Reviewed-on: https://go-review.googlesource.com/c/tools/+/192477
Run-TryBot: Suzy Mueller <suzmue@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-09-03 16:36:17 +00:00

311 lines
3.6 KiB
Plaintext

-- foldingRange-0 --
package folding //@fold("package")
import (<>)
import _ "os"
// bar is a function.<>
func bar(<>) string {<>}
-- foldingRange-1 --
package folding //@fold("package")
import (
"fmt"
_ "log"
)
import _ "os"
// bar is a function.
// With a multiline doc comment.
func bar() string {
switch {<>}
return `
this string
is not indented`
}
-- foldingRange-2 --
package folding //@fold("package")
import (
"fmt"
_ "log"
)
import _ "os"
// bar is a function.
// With a multiline doc comment.
func bar() string {
switch {
case true:<>
case false:<>
default:<>
}
return `
this string
is not indented`
}
-- foldingRange-3 --
package folding //@fold("package")
import (
"fmt"
_ "log"
)
import _ "os"
// bar is a function.
// With a multiline doc comment.
func bar() string {
switch {
case true:
if true {<>}
case false:
fmt.Println(<>)
default:
fmt.Println(<>)
}
return `
this string
is not indented`
}
-- foldingRange-4 --
package folding //@fold("package")
import (
"fmt"
_ "log"
)
import _ "os"
// bar is a function.
// With a multiline doc comment.
func bar() string {
switch {
case true:
if true {
fmt.Println(<>)
}
case false:
fmt.Println("false")
default:
fmt.Println("default")
}
return `
this string
is not indented`
}
-- foldingRange-comment-0 --
package folding //@fold("package")
import (
"fmt"
_ "log"
)
import _ "os"
// bar is a function.<>
func bar() string {
switch {
case true:
if true {
fmt.Println("true")
}
case false:
fmt.Println("false")
default:
fmt.Println("default")
}
return `
this string
is not indented`
}
-- foldingRange-imports-0 --
package folding //@fold("package")
import (<>)
import _ "os"
// bar is a function.
// With a multiline doc comment.
func bar() string {
switch {
case true:
if true {
fmt.Println("true")
}
case false:
fmt.Println("false")
default:
fmt.Println("default")
}
return `
this string
is not indented`
}
-- foldingRange-lineFolding-0 --
package folding //@fold("package")
import (<>)
import _ "os"
// bar is a function.<>
func bar() string {<>}
-- foldingRange-lineFolding-1 --
package folding //@fold("package")
import (
"fmt"
_ "log"
)
import _ "os"
// bar is a function.
// With a multiline doc comment.
func bar() string {
switch {<>}
return `
this string
is not indented`
}
-- foldingRange-lineFolding-2 --
package folding //@fold("package")
import (
"fmt"
_ "log"
)
import _ "os"
// bar is a function.
// With a multiline doc comment.
func bar() string {
switch {
case true:<>
case false:<>
default:<>
}
return `
this string
is not indented`
}
-- foldingRange-lineFolding-3 --
package folding //@fold("package")
import (
"fmt"
_ "log"
)
import _ "os"
// bar is a function.
// With a multiline doc comment.
func bar() string {
switch {
case true:
if true {<>}
case false:
fmt.Println("false")
default:
fmt.Println("default")
}
return `
this string
is not indented`
}
-- foldingRange-lineFolding-comment-0 --
package folding //@fold("package")
import (
"fmt"
_ "log"
)
import _ "os"
// bar is a function.<>
func bar() string {
switch {
case true:
if true {
fmt.Println("true")
}
case false:
fmt.Println("false")
default:
fmt.Println("default")
}
return `
this string
is not indented`
}
-- foldingRange-lineFolding-imports-0 --
package folding //@fold("package")
import (<>)
import _ "os"
// bar is a function.
// With a multiline doc comment.
func bar() string {
switch {
case true:
if true {
fmt.Println("true")
}
case false:
fmt.Println("false")
default:
fmt.Println("default")
}
return `
this string
is not indented`
}