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

Function createSpacing

internal/compose/completion.go:142–156  ·  view source on GitHub ↗
(line string, character int, arrayAttributes bool)

Source from the content-addressed store, hash-verified

140}
141
142func createSpacing(line string, character int, arrayAttributes bool) string {
143 if arrayAttributes {
144 // 2 more for the attribute, then 2 more for the array offset = 4 total
145 return strings.Repeat(" ", character+4)
146 }
147 sb := strings.Builder{}
148 sb.Grow(character + 2)
149 for i := range character {
150 if unicode.IsSpace(rune(line[i])) || line[i] == '-' {
151 sb.WriteString(" ")
152 }
153 }
154 sb.WriteString(" ")
155 return sb.String()
156}
157
158func createTopLevelItems() []protocol.CompletionItem {
159 items := []protocol.CompletionItem{}

Callers 1

createSchemaItemsFunction · 0.85

Calls 1

StringMethod · 0.80

Tested by

no test coverage detected