MCPcopy Create free account
hub / github.com/docker/docker-language-server / includedPaths

Function includedPaths

internal/compose/documentLink.go:195–238  ·  view source on GitHub ↗
(nodes []ast.Node)

Source from the content-addressed store, hash-verified

193}
194
195func includedPaths(nodes []ast.Node) []*token.Token {
196 tokens := []*token.Token{}
197 for _, entry := range nodes {
198 if mappingNode, ok := resolveAnchor(entry).(*ast.MappingNode); ok {
199 for _, value := range mappingNode.Values {
200 attributeName := resolveAnchor(value.Key).GetToken().Value
201 if attributeName == "path" || attributeName == "env_file" {
202 if paths, ok := resolveAnchor(value.Value).(*ast.SequenceNode); ok {
203 // include:
204 // - path:
205 // - ../commons/compose.yaml
206 // - ./commons-override.yaml
207 // - env_file:
208 // - ../another/.env
209 // - ../another/dev.env
210 for _, path := range paths.Values {
211 if _, ok := path.(*ast.AliasNode); !ok {
212 tokens = append(tokens, resolveAnchor(path).GetToken())
213 }
214 }
215 } else {
216 // include:
217 // - path: ../commons/compose.yaml
218 // project_directory: ..
219 // env_file: ../another/.env
220 if _, ok := value.Value.(*ast.AliasNode); !ok {
221 tokens = append(tokens, resolveAnchor(value.Value).GetToken())
222 }
223 }
224 }
225 }
226 } else {
227 // include:
228 // - abc.yml
229 // - def.yml
230 stringNode := stringNode(entry)
231 if stringNode != nil {
232 tokens = append(tokens, stringNode.GetToken())
233 }
234
235 }
236 }
237 return tokens
238}
239
240func scanForLinks(folderAbsolutePath string, wslDollarSign bool, n *ast.MappingValueNode) []protocol.DocumentLink {
241 if s, ok := resolveAnchor(n.Key).(*ast.StringNode); ok {

Callers 1

scanForLinksFunction · 0.85

Calls 2

resolveAnchorFunction · 0.85
stringNodeFunction · 0.85

Tested by

no test coverage detected