(doc document.ComposeDocument, mappingNode *ast.MappingNode, nodePath []ast.Node)
| 109 | } |
| 110 | |
| 111 | func serviceHover(doc document.ComposeDocument, mappingNode *ast.MappingNode, nodePath []ast.Node) *protocol.Hover { |
| 112 | if (len(nodePath) == 4 || len(nodePath) == 5) && nodePath[0].GetToken().Value == "services" { |
| 113 | t := nodePath[3].GetToken() |
| 114 | if nodePath[2].GetToken().Value == "extends" { |
| 115 | if len(nodePath) == 5 && t.Value == "service" { |
| 116 | if _, ok := nodePath[4].(*ast.StringNode); ok { |
| 117 | t = nodePath[4].GetToken() |
| 118 | if t.Next != nil && t.Next.Type == token.MappingValueType { |
| 119 | return nil |
| 120 | } |
| 121 | } else { |
| 122 | return nil |
| 123 | } |
| 124 | } else if t.Next != nil && t.Next.Type == token.MappingValueType { |
| 125 | return nil |
| 126 | } |
| 127 | result := createDependencyHover(doc, mappingNode, t, "services", t.Value) |
| 128 | if result != nil { |
| 129 | return result |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | if nodePath[2].GetToken().Value == "depends_on" { |
| 134 | if t.Next != nil && t.Next.Type == token.MappingValueType && t.Prev.Type == token.SequenceEntryType { |
| 135 | return nil |
| 136 | } |
| 137 | result := createDependencyHover(doc, mappingNode, t, "services", t.Value) |
| 138 | if result != nil { |
| 139 | return result |
| 140 | } |
| 141 | } |
| 142 | } |
| 143 | return nil |
| 144 | } |
| 145 | |
| 146 | func networkHover(doc document.ComposeDocument, mappingNode *ast.MappingNode, nodePath []ast.Node) *protocol.Hover { |
| 147 | if len(nodePath) == 4 && nodePath[0].GetToken().Value == "services" { |
no test coverage detected