golang.org/x/tools/gopls@v0.15.3/internal/test/marker/testdata/completion/nested_complit.txt (about)

     1  This test checks completion of nested composite literals;
     2  
     3  Parser recovery changed in Go 1.20, so this test requires at least that
     4  version for consistency.
     5  
     6  -- flags --
     7  -ignore_extra_diags
     8  -min_go=go1.20
     9  
    10  -- nested_complit.go --
    11  package nested_complit
    12  
    13  type ncFoo struct {} //@item(structNCFoo, "ncFoo", "struct{...}", "struct")
    14  
    15  type ncBar struct { //@item(structNCBar, "ncBar", "struct{...}", "struct")
    16  	baz []ncFoo
    17  }
    18  
    19  func _() {
    20  	_ = []ncFoo{} //@item(litNCFoo, "[]ncFoo{}", "", "var")
    21  	_ = make([]ncFoo, 0) //@item(makeNCFoo, "make([]ncFoo, 0)", "", "func")
    22  
    23  	_ := ncBar{
    24  		baz: [] //@complete(" //", litNCFoo, makeNCFoo, structNCBar, structNCFoo)
    25  	}
    26  }