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

Function createImageLink

internal/compose/documentLink.go:74–89  ·  view source on GitHub ↗
(serviceNode *ast.MappingValueNode)

Source from the content-addressed store, hash-verified

72}
73
74func createImageLink(serviceNode *ast.MappingValueNode) *protocol.DocumentLink {
75 if resolveAnchor(serviceNode.Key).GetToken().Value == "image" {
76 service := stringNode(serviceNode.Value)
77 if service != nil {
78 linkedText, link := extractImageLink(service.Value)
79 if linkedText != "" {
80 return &protocol.DocumentLink{
81 Range: createRange(service.GetToken(), len(linkedText)),
82 Target: types.CreateStringPointer(link),
83 Tooltip: types.CreateStringPointer(link),
84 }
85 }
86 }
87 }
88 return nil
89}
90
91func createFileLinks(folderAbsolutePath string, wslDollarSign bool, serviceNode *ast.MappingValueNode, attributeName string) []protocol.DocumentLink {
92 if resolveAnchor(serviceNode.Key).GetToken().Value == attributeName {

Callers 1

scanForLinksFunction · 0.85

Calls 5

CreateStringPointerFunction · 0.92
resolveAnchorFunction · 0.85
stringNodeFunction · 0.85
extractImageLinkFunction · 0.85
createRangeFunction · 0.70

Tested by

no test coverage detected