-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefinition.json
More file actions
96 lines (96 loc) · 2.42 KB
/
Copy pathdefinition.json
File metadata and controls
96 lines (96 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
[
{
"name": "Variable definition jumps to declaration",
"content": "{{ $test := 0 }}\n{{ $te<cursor>st }}",
"expected": {
"targetLine": 0,
"minCount": 1
}
},
{
"name": "Redeclared variable shows at least one definition",
"content": "{{ $test := 0 }}\n{{ $test }}\n{{ $test := 1 }}\n{{ $te<cursor>st }}",
"expected": {
"minCount": 1
}
},
{
"name": "Redeclared variable shows multiple definitions",
"content": "{{ $test := 0 }}\n{{ $test }}\n{{ $test := 1 }}\n{{ $te<cursor>st }}",
"vscodeOnly": true,
"expected": {
"count": 2
}
},
{
"name": "Dot in range jumps to range pipe",
"content": "{{- range .Join }}\n{{ <cursor>. }}\n{{- end }}",
"expected": {
"targetLine": 0,
"minCount": 1
}
},
{
"name": "Field jumps to struct field declaration",
"content": "{{/*gotype: cg/model.Order*/}}\n{{ .C<cursor>ustomerName }}",
"poll": true,
"expected": {
"minCount": 1,
"targetFile": "model.go",
"targetLine": 89
}
},
{
"name": "Method jumps to method declaration",
"content": "{{/*gotype: cg/model.Order*/}}\n{{ .D<cursor>isplayName }}",
"poll": true,
"expected": {
"minCount": 1,
"targetFile": "model.go",
"targetLine": 98
}
},
{
"name": "Nested field first identifier jumps to field",
"content": "{{/*gotype: cg/model.Order*/}}\n{{ .A<cursor>ddress.City }}",
"poll": true,
"expected": {
"minCount": 1,
"targetFile": "model.go",
"targetLine": 91
}
},
{
"name": "Nested field second identifier jumps to nested field",
"content": "{{/*gotype: cg/model.Order*/}}\n{{ .Address.C<cursor>ity }}",
"poll": true,
"expected": {
"minCount": 1,
"targetFile": "model.go",
"targetLine": 7
}
},
{
"name": "Unknown field returns no results",
"content": "{{/*gotype: cg/model.Order*/}}\n{{ .N<cursor>onExistent }}",
"vscodeOnly": true,
"expected": {
"noResult": true
}
},
{
"name": "Template invocation jumps to define block",
"content": "{{ template \"My<cursor>Tpl\" . }}\n\n\n{{ define \"MyTpl\" }}hello{{ end }}",
"expected": {
"minCount": 1
}
},
{
"name": "Template invocation with unknown name returns no results",
"content": "{{ template \"Miss<cursor>ing\" . }}",
"vscodeOnly": true,
"expected": {
"noResult": true
}
}
]