@@ -52,15 +52,15 @@ services:
52
52
},
53
53
},
54
54
{
55
- name : "attribute recurses upwards" ,
55
+ name : "attribute recurses upwards for a match " ,
56
56
content : `
57
57
services:
58
58
web:
59
59
attach: true
60
60
web2:
61
61
extends: web
62
62
web3:
63
- extends: web
63
+ extends: web2
64
64
attach: false` ,
65
65
inlayHints : []protocol.InlayHint {
66
66
{
@@ -70,6 +70,60 @@ services:
70
70
},
71
71
},
72
72
},
73
+ {
74
+ name : "extension at different levels have the right value" ,
75
+ content : `
76
+ services:
77
+ web:
78
+ hostname: hostname1
79
+ web2:
80
+ extends: web
81
+ hostname: hostname2
82
+ web3:
83
+ extends: web2
84
+ hostname: hostname3` ,
85
+ inlayHints : []protocol.InlayHint {
86
+ {
87
+ Label : "(parent value: hostname1)" ,
88
+ PaddingLeft : types .CreateBoolPointer (true ),
89
+ Position : protocol.Position {Line : 6 , Character : 23 },
90
+ },
91
+ {
92
+ Label : "(parent value: hostname2)" ,
93
+ PaddingLeft : types .CreateBoolPointer (true ),
94
+ Position : protocol.Position {Line : 9 , Character : 23 },
95
+ },
96
+ },
97
+ },
98
+ {
99
+ name : "self recursion returns nothing" ,
100
+ content : `
101
+ services:
102
+ web:
103
+ hostname: hostname1
104
+ extends: web2` ,
105
+ inlayHints : []protocol.InlayHint {},
106
+ },
107
+ {
108
+ name : "self recursion does not affect other hints" ,
109
+ content : `
110
+ services:
111
+ web:
112
+ hostname: hostname1
113
+ web2:
114
+ extends: web
115
+ hostname: hostname2
116
+ web3:
117
+ extends: web3
118
+ hostname: hostname3` ,
119
+ inlayHints : []protocol.InlayHint {
120
+ {
121
+ Label : "(parent value: hostname1)" ,
122
+ PaddingLeft : types .CreateBoolPointer (true ),
123
+ Position : protocol.Position {Line : 6 , Character : 23 },
124
+ },
125
+ },
126
+ },
73
127
{
74
128
name : "extends as an object but without a file attribute" ,
75
129
content : `
@@ -118,6 +172,19 @@ services:
118
172
},
119
173
},
120
174
},
175
+ {
176
+ name : "unmatched tree structure should not render any hints" ,
177
+ content : `
178
+ services:
179
+ web:
180
+ build: .
181
+ context: abc
182
+ web2:
183
+ extends: web
184
+ build:
185
+ context: def` ,
186
+ inlayHints : []protocol.InlayHint {},
187
+ },
121
188
{
122
189
name : "sub-attributes unsupported" ,
123
190
content : `
0 commit comments