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