github.com/v2fly/tools@v0.100.0/internal/lsp/testdata/folding/a.go.golden (about) 1 -- foldingRange-0 -- 2 package folding //@fold("package") 3 4 import (<>) 5 6 import _ "os" 7 8 // bar is a function.<> 9 func bar(<>) string {<>} 10 11 -- foldingRange-1 -- 12 package folding //@fold("package") 13 14 import ( 15 "fmt" 16 _ "log" 17 ) 18 19 import _ "os" 20 21 // bar is a function. 22 // With a multiline doc comment. 23 func bar() string { 24 switch {<>} 25 _ = []int{<>} 26 _ = [2]string{<>} 27 _ = map[string]int{<>} 28 type T struct {<>} 29 _ = T{<>} 30 x, y := make(<>), make(<>) 31 select {<>} 32 // This is a multiline comment<> 33 return ` 34 this string 35 is not indented` 36 } 37 38 -- foldingRange-2 -- 39 package folding //@fold("package") 40 41 import ( 42 "fmt" 43 _ "log" 44 ) 45 46 import _ "os" 47 48 // bar is a function. 49 // With a multiline doc comment. 50 func bar() string { 51 switch { 52 case true:<> 53 case false:<> 54 default:<> 55 } 56 _ = []int{ 57 1, 58 2, 59 3, 60 } 61 _ = [2]string{"d", 62 "e", 63 } 64 _ = map[string]int{ 65 "a": 1, 66 "b": 2, 67 "c": 3, 68 } 69 type T struct { 70 f string 71 g int 72 h string 73 } 74 _ = T{ 75 f: "j", 76 g: 4, 77 h: "i", 78 } 79 x, y := make(chan bool), make(chan bool) 80 select { 81 case val := <-x:<> 82 case <-y:<> 83 default:<> 84 } 85 // This is a multiline comment 86 // that is not a doc comment. 87 return ` 88 this string 89 is not indented` 90 } 91 92 -- foldingRange-3 -- 93 package folding //@fold("package") 94 95 import ( 96 "fmt" 97 _ "log" 98 ) 99 100 import _ "os" 101 102 // bar is a function. 103 // With a multiline doc comment. 104 func bar() string { 105 switch { 106 case true: 107 if true {<>} else {<>} 108 case false: 109 fmt.Println(<>) 110 default: 111 fmt.Println(<>) 112 } 113 _ = []int{ 114 1, 115 2, 116 3, 117 } 118 _ = [2]string{"d", 119 "e", 120 } 121 _ = map[string]int{ 122 "a": 1, 123 "b": 2, 124 "c": 3, 125 } 126 type T struct { 127 f string 128 g int 129 h string 130 } 131 _ = T{ 132 f: "j", 133 g: 4, 134 h: "i", 135 } 136 x, y := make(chan bool), make(chan bool) 137 select { 138 case val := <-x: 139 if val {<>} else {<>} 140 case <-y: 141 fmt.Println(<>) 142 default: 143 fmt.Println(<>) 144 } 145 // This is a multiline comment 146 // that is not a doc comment. 147 return ` 148 this string 149 is not indented` 150 } 151 152 -- foldingRange-4 -- 153 package folding //@fold("package") 154 155 import ( 156 "fmt" 157 _ "log" 158 ) 159 160 import _ "os" 161 162 // bar is a function. 163 // With a multiline doc comment. 164 func bar() string { 165 switch { 166 case true: 167 if true { 168 fmt.Println(<>) 169 } else { 170 fmt.Println(<>) 171 } 172 case false: 173 fmt.Println("false") 174 default: 175 fmt.Println("default") 176 } 177 _ = []int{ 178 1, 179 2, 180 3, 181 } 182 _ = [2]string{"d", 183 "e", 184 } 185 _ = map[string]int{ 186 "a": 1, 187 "b": 2, 188 "c": 3, 189 } 190 type T struct { 191 f string 192 g int 193 h string 194 } 195 _ = T{ 196 f: "j", 197 g: 4, 198 h: "i", 199 } 200 x, y := make(chan bool), make(chan bool) 201 select { 202 case val := <-x: 203 if val { 204 fmt.Println(<>) 205 } else { 206 fmt.Println(<>) 207 } 208 case <-y: 209 fmt.Println("y") 210 default: 211 fmt.Println("default") 212 } 213 // This is a multiline comment 214 // that is not a doc comment. 215 return ` 216 this string 217 is not indented` 218 } 219 220 -- foldingRange-cmd -- 221 3:9-6:0 222 10:22-11:32 223 12:10-12:9 224 12:20-66:0 225 13:10-24:1 226 14:12-19:3 227 15:12-17:2 228 16:16-16:21 229 17:11-19:2 230 18:16-18:22 231 20:13-21:22 232 21:15-21:21 233 22:10-23:24 234 23:15-23:23 235 25:12-29:1 236 30:16-32:1 237 33:21-37:1 238 38:17-42:1 239 43:8-47:1 240 48:15-48:23 241 48:32-48:40 242 49:10-60:1 243 50:18-55:3 244 51:11-53:2 245 52:16-52:28 246 53:11-55:2 247 54:16-54:29 248 56:11-57:18 249 57:15-57:17 250 58:10-59:24 251 59:15-59:23 252 61:32-62:30 253 254 -- foldingRange-comment-0 -- 255 package folding //@fold("package") 256 257 import ( 258 "fmt" 259 _ "log" 260 ) 261 262 import _ "os" 263 264 // bar is a function.<> 265 func bar() string { 266 switch { 267 case true: 268 if true { 269 fmt.Println("true") 270 } else { 271 fmt.Println("false") 272 } 273 case false: 274 fmt.Println("false") 275 default: 276 fmt.Println("default") 277 } 278 _ = []int{ 279 1, 280 2, 281 3, 282 } 283 _ = [2]string{"d", 284 "e", 285 } 286 _ = map[string]int{ 287 "a": 1, 288 "b": 2, 289 "c": 3, 290 } 291 type T struct { 292 f string 293 g int 294 h string 295 } 296 _ = T{ 297 f: "j", 298 g: 4, 299 h: "i", 300 } 301 x, y := make(chan bool), make(chan bool) 302 select { 303 case val := <-x: 304 if val { 305 fmt.Println("true from x") 306 } else { 307 fmt.Println("false from x") 308 } 309 case <-y: 310 fmt.Println("y") 311 default: 312 fmt.Println("default") 313 } 314 // This is a multiline comment<> 315 return ` 316 this string 317 is not indented` 318 } 319 320 -- foldingRange-imports-0 -- 321 package folding //@fold("package") 322 323 import (<>) 324 325 import _ "os" 326 327 // bar is a function. 328 // With a multiline doc comment. 329 func bar() string { 330 switch { 331 case true: 332 if true { 333 fmt.Println("true") 334 } else { 335 fmt.Println("false") 336 } 337 case false: 338 fmt.Println("false") 339 default: 340 fmt.Println("default") 341 } 342 _ = []int{ 343 1, 344 2, 345 3, 346 } 347 _ = [2]string{"d", 348 "e", 349 } 350 _ = map[string]int{ 351 "a": 1, 352 "b": 2, 353 "c": 3, 354 } 355 type T struct { 356 f string 357 g int 358 h string 359 } 360 _ = T{ 361 f: "j", 362 g: 4, 363 h: "i", 364 } 365 x, y := make(chan bool), make(chan bool) 366 select { 367 case val := <-x: 368 if val { 369 fmt.Println("true from x") 370 } else { 371 fmt.Println("false from x") 372 } 373 case <-y: 374 fmt.Println("y") 375 default: 376 fmt.Println("default") 377 } 378 // This is a multiline comment 379 // that is not a doc comment. 380 return ` 381 this string 382 is not indented` 383 } 384 385 -- foldingRange-lineFolding-0 -- 386 package folding //@fold("package") 387 388 import (<> 389 ) 390 391 import _ "os" 392 393 // bar is a function.<> 394 func bar() string {<> 395 } 396 397 -- foldingRange-lineFolding-1 -- 398 package folding //@fold("package") 399 400 import ( 401 "fmt" 402 _ "log" 403 ) 404 405 import _ "os" 406 407 // bar is a function. 408 // With a multiline doc comment. 409 func bar() string { 410 switch {<> 411 } 412 _ = []int{<>, 413 } 414 _ = [2]string{"d", 415 "e", 416 } 417 _ = map[string]int{<>, 418 } 419 type T struct {<> 420 } 421 _ = T{<>, 422 } 423 x, y := make(chan bool), make(chan bool) 424 select {<> 425 } 426 // This is a multiline comment<> 427 return ` 428 this string 429 is not indented` 430 } 431 432 -- foldingRange-lineFolding-2 -- 433 package folding //@fold("package") 434 435 import ( 436 "fmt" 437 _ "log" 438 ) 439 440 import _ "os" 441 442 // bar is a function. 443 // With a multiline doc comment. 444 func bar() string { 445 switch { 446 case true:<> 447 case false:<> 448 default:<> 449 } 450 _ = []int{ 451 1, 452 2, 453 3, 454 } 455 _ = [2]string{"d", 456 "e", 457 } 458 _ = map[string]int{ 459 "a": 1, 460 "b": 2, 461 "c": 3, 462 } 463 type T struct { 464 f string 465 g int 466 h string 467 } 468 _ = T{ 469 f: "j", 470 g: 4, 471 h: "i", 472 } 473 x, y := make(chan bool), make(chan bool) 474 select { 475 case val := <-x:<> 476 case <-y:<> 477 default:<> 478 } 479 // This is a multiline comment 480 // that is not a doc comment. 481 return ` 482 this string 483 is not indented` 484 } 485 486 -- foldingRange-lineFolding-3 -- 487 package folding //@fold("package") 488 489 import ( 490 "fmt" 491 _ "log" 492 ) 493 494 import _ "os" 495 496 // bar is a function. 497 // With a multiline doc comment. 498 func bar() string { 499 switch { 500 case true: 501 if true {<> 502 } else {<> 503 } 504 case false: 505 fmt.Println("false") 506 default: 507 fmt.Println("default") 508 } 509 _ = []int{ 510 1, 511 2, 512 3, 513 } 514 _ = [2]string{"d", 515 "e", 516 } 517 _ = map[string]int{ 518 "a": 1, 519 "b": 2, 520 "c": 3, 521 } 522 type T struct { 523 f string 524 g int 525 h string 526 } 527 _ = T{ 528 f: "j", 529 g: 4, 530 h: "i", 531 } 532 x, y := make(chan bool), make(chan bool) 533 select { 534 case val := <-x: 535 if val {<> 536 } else {<> 537 } 538 case <-y: 539 fmt.Println("y") 540 default: 541 fmt.Println("default") 542 } 543 // This is a multiline comment 544 // that is not a doc comment. 545 return ` 546 this string 547 is not indented` 548 } 549 550 -- foldingRange-lineFolding-comment-0 -- 551 package folding //@fold("package") 552 553 import ( 554 "fmt" 555 _ "log" 556 ) 557 558 import _ "os" 559 560 // bar is a function.<> 561 func bar() string { 562 switch { 563 case true: 564 if true { 565 fmt.Println("true") 566 } else { 567 fmt.Println("false") 568 } 569 case false: 570 fmt.Println("false") 571 default: 572 fmt.Println("default") 573 } 574 _ = []int{ 575 1, 576 2, 577 3, 578 } 579 _ = [2]string{"d", 580 "e", 581 } 582 _ = map[string]int{ 583 "a": 1, 584 "b": 2, 585 "c": 3, 586 } 587 type T struct { 588 f string 589 g int 590 h string 591 } 592 _ = T{ 593 f: "j", 594 g: 4, 595 h: "i", 596 } 597 x, y := make(chan bool), make(chan bool) 598 select { 599 case val := <-x: 600 if val { 601 fmt.Println("true from x") 602 } else { 603 fmt.Println("false from x") 604 } 605 case <-y: 606 fmt.Println("y") 607 default: 608 fmt.Println("default") 609 } 610 // This is a multiline comment<> 611 return ` 612 this string 613 is not indented` 614 } 615 616 -- foldingRange-lineFolding-imports-0 -- 617 package folding //@fold("package") 618 619 import (<> 620 ) 621 622 import _ "os" 623 624 // bar is a function. 625 // With a multiline doc comment. 626 func bar() string { 627 switch { 628 case true: 629 if true { 630 fmt.Println("true") 631 } else { 632 fmt.Println("false") 633 } 634 case false: 635 fmt.Println("false") 636 default: 637 fmt.Println("default") 638 } 639 _ = []int{ 640 1, 641 2, 642 3, 643 } 644 _ = [2]string{"d", 645 "e", 646 } 647 _ = map[string]int{ 648 "a": 1, 649 "b": 2, 650 "c": 3, 651 } 652 type T struct { 653 f string 654 g int 655 h string 656 } 657 _ = T{ 658 f: "j", 659 g: 4, 660 h: "i", 661 } 662 x, y := make(chan bool), make(chan bool) 663 select { 664 case val := <-x: 665 if val { 666 fmt.Println("true from x") 667 } else { 668 fmt.Println("false from x") 669 } 670 case <-y: 671 fmt.Println("y") 672 default: 673 fmt.Println("default") 674 } 675 // This is a multiline comment 676 // that is not a doc comment. 677 return ` 678 this string 679 is not indented` 680 } 681