| 1 |
This test verifies behavior of textDocument/foldingRange in the presence of |
| 2 |
unformatted syntax. |
| 3 |
|
| 4 |
-- a.go -- |
| 5 |
package folding //@foldingrange(raw) |
| 6 |
|
| 7 |
import ( "fmt" |
| 8 |
_ "log" |
| 9 |
) |
| 10 |
|
| 11 |
import ( |
| 12 |
_ "os" ) |
| 13 |
|
| 14 |
// BadBar is a function. |
| 15 |
func BadBar() string { x := true |
| 16 |
if x { |
| 17 |
// This is the only foldable thing in this file when lineFoldingOnly |
| 18 |
fmt.Println("true") |
| 19 |
} else { |
| 20 |
fmt.Println("false") } |
| 21 |
return "" |
| 22 |
} |
| 23 |
-- @raw -- |
| 24 |
package folding //@foldingrange(raw) |
| 25 |
|
| 26 |
import (<0 kind="imports"> "fmt" |
| 27 |
_ "log" |
| 28 |
</0>) |
| 29 |
|
| 30 |
import (<1 kind="imports"> |
| 31 |
_ "os" </1>) |
| 32 |
|
| 33 |
// BadBar is a function. |
| 34 |
func BadBar() string {<2 kind=""> x := true |
| 35 |
if x {<3 kind=""> |
| 36 |
// This is the only foldable thing in this file when lineFoldingOnly |
| 37 |
fmt.Println(<4 kind="">"true"</4>) |
| 38 |
</3>} else {<5 kind=""> |
| 39 |
fmt.Println(<6 kind="">"false"</6>) </5>} |
| 40 |
return "" |
| 41 |
</2>} |