Debian Codegraph @

gopls/internal/test/marker/testdata/quickfix/stubmethods/fromcall_params.txt

raw
1 This test checks the param name and type of the generated missing method based on CallExpr.
2
3 -- basic_stub.go --
4 package fromcallparams
5
6 type A struct{}
7
8 func untypedParams() {
9 a := A{}
10 a.untyped("s", 42, 4.12, make(map[string]int), []int{1}, [1]int{1}, make(chan string)) //@quickfix("untyped", re"has no field or method", basic)
11 }
12 -- @basic/basic_stub.go --
13 @@ -5 +5,4 @@
14 +func (a A) untyped(s string, i int, f float64, m map[string]int, param5 []int, param6 [1]int, ch chan string) {
15 + panic("unimplemented")
16 +}
17 +
18 -- nonexistent_type.go --
19 package fromcallparams
20
21 type B struct{}
22
23 func invalidBasicKindParam() {
24 b := B{}
25 b.basicKind(NonExistentType{}) //@quickfix("basicKind", re"has no field or method", nonexistent),diag(re"NonExistentType",re"undefined: NonExistentType")
26 }
27 -- @nonexistent/nonexistent_type.go --
28 @@ -5 +5,4 @@
29 +func (b B) basicKind(param any) {
30 + panic("unimplemented")
31 +}
32 +
33 -- pass_param_by_ident.go --
34 package fromcallparams
35
36 type C struct{}
37
38 func passParamByIdent() {
39 c := C{}
40 stringVar := "some string"
41 intVar := 1
42 sliceVar := []int{1}
43 c.ident(stringVar, intVar, sliceVar) //@quickfix("ident", re"has no field or method", ident)
44 }
45 -- @ident/pass_param_by_ident.go --
46 @@ -5 +5,4 @@
47 +func (c C) ident(stringVar string, intVar int, sliceVar []int) {
48 + panic("unimplemented")
49 +}
50 +
51 -- tail_param_name.go --
52 package fromcallparams
53
54 type Tail struct{}
55
56 type TypeWithLongName struct{}
57
58 func TailParamName() {
59 t := Tail{}
60 t.longName(TypeWithLongName{}) //@quickfix("longName", re"has no field or method", trail)
61 }
62 -- @trail/tail_param_name.go --
63 @@ -5 +5,4 @@
64 +func (t Tail) longName(name TypeWithLongName) {
65 + panic("unimplemented")
66 +}
67 +
68 -- selector_param_name.go --
69 package fromcallparams
70
71 import "net/http"
72
73 type Select struct{}
74
75 func selectExpr() {
76 s := Select{}
77 s.sel(http.ErrNotMultipart) //@quickfix("sel", re"has no field or method", select)
78 }
79 -- @select/selector_param_name.go --
80 @@ -7 +7,4 @@
81 +func (s Select) sel(multipart *http.ProtocolError) {
82 + panic("unimplemented")
83 +}
84 +