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

Function nodeProperties

internal/compose/schema.go:38–51  ·  view source on GitHub ↗
(nodes []*ast.MappingValueNode, line, column int)

Source from the content-addressed store, hash-verified

36}
37
38func nodeProperties(nodes []*ast.MappingValueNode, line, column int) ([]*ast.MappingValueNode, any, bool) {
39 if composeSchema != nil && slices.Contains(composeSchema.Types.ToStrings(), "object") && composeSchema.Properties != nil {
40 if prop, ok := composeSchema.Properties[nodes[0].Key.GetToken().Value]; ok {
41 for regexp, property := range prop.PatternProperties {
42 if regexp.MatchString(nodes[1].Key.GetToken().Value) {
43 if property.Ref != nil {
44 return recurseNodeProperties(nodes, line, column, 2, property.Ref.Properties, false)
45 }
46 }
47 }
48 }
49 }
50 return nodes, nil, false
51}
52
53func recurseNodeProperties(nodes []*ast.MappingValueNode, line, column, nodeOffset int, properties map[string]*jsonschema.Schema, arrayAttributes bool) ([]*ast.MappingValueNode, any, bool) {
54 if len(nodes) == nodeOffset {

Callers 1

CompletionFunction · 0.85

Calls 1

recurseNodePropertiesFunction · 0.85

Tested by

no test coverage detected