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

Function createFileLinks

internal/compose/documentLink.go:91–109  ·  view source on GitHub ↗
(folderAbsolutePath string, wslDollarSign bool, serviceNode *ast.MappingValueNode, attributeName string)

Source from the content-addressed store, hash-verified

89}
90
91func createFileLinks(folderAbsolutePath string, wslDollarSign bool, serviceNode *ast.MappingValueNode, attributeName string) []protocol.DocumentLink {
92 if resolveAnchor(serviceNode.Key).GetToken().Value == attributeName {
93 if sequence, ok := resolveAnchor(serviceNode.Value).(*ast.SequenceNode); ok {
94 links := []protocol.DocumentLink{}
95 for _, node := range sequence.Values {
96 if s, ok := resolveAnchor(node).(*ast.StringNode); ok {
97 links = append(links, *createLink(folderAbsolutePath, wslDollarSign, s.GetToken()))
98 }
99 }
100 return links
101 }
102
103 link := createFileLink(folderAbsolutePath, wslDollarSign, serviceNode)
104 if link != nil {
105 return []protocol.DocumentLink{*link}
106 }
107 }
108 return nil
109}
110
111func createVolumeFileLinks(folderAbsolutePath string, wslDollarSign bool, serviceNode *ast.MappingValueNode) []protocol.DocumentLink {
112 if resolveAnchor(serviceNode.Key).GetToken().Value == "volumes" {

Callers 1

scanForLinksFunction · 0.85

Calls 3

resolveAnchorFunction · 0.85
createLinkFunction · 0.85
createFileLinkFunction · 0.85

Tested by

no test coverage detected