(doc document.ComposeDocument, mappingNode *ast.MappingNode, nodePath []ast.Node)
| 171 | } |
| 172 | |
| 173 | func secretHover(doc document.ComposeDocument, mappingNode *ast.MappingNode, nodePath []ast.Node) *protocol.Hover { |
| 174 | if len(nodePath) >= 4 && nodePath[0].GetToken().Value == "services" { |
| 175 | if len(nodePath) == 4 { |
| 176 | // array string |
| 177 | if nodePath[2].GetToken().Value == "secrets" { |
| 178 | t := nodePath[3].GetToken() |
| 179 | return createDependencyHover(doc, mappingNode, t, "secrets", t.Value) |
| 180 | } |
| 181 | } else if len(nodePath) == 5 { |
| 182 | // array object |
| 183 | if nodePath[2].GetToken().Value == "secrets" && nodePath[3].GetToken().Value == "source" { |
| 184 | t := nodePath[4].GetToken() |
| 185 | return createDependencyHover(doc, mappingNode, t, "secrets", t.Value) |
| 186 | } else if nodePath[2].GetToken().Value == "build" && nodePath[3].GetToken().Value == "secrets" { |
| 187 | // array string in the build object |
| 188 | t := nodePath[4].GetToken() |
| 189 | return createDependencyHover(doc, mappingNode, t, "secrets", t.Value) |
| 190 | } |
| 191 | } else if len(nodePath) == 6 { |
| 192 | // array object in the build object |
| 193 | if nodePath[2].GetToken().Value == "build" && nodePath[3].GetToken().Value == "secrets" && nodePath[4].GetToken().Value == "source" { |
| 194 | t := nodePath[5].GetToken() |
| 195 | return createDependencyHover(doc, mappingNode, t, "secrets", t.Value) |
| 196 | } |
| 197 | } |
| 198 | } |
| 199 | return nil |
| 200 | } |
| 201 | |
| 202 | func volumeHover(doc document.ComposeDocument, params *protocol.HoverParams, mappingNode *ast.MappingNode, nodePath []ast.Node) *protocol.Hover { |
| 203 | if len(nodePath) >= 4 && nodePath[0].GetToken().Value == "services" { |
no test coverage detected