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

Function calculateTopLevelNodeOffset

internal/compose/completion.go:173–180  ·  view source on GitHub ↗
(file *ast.File)

Source from the content-addressed store, hash-verified

171}
172
173func calculateTopLevelNodeOffset(file *ast.File) int {
174 if len(file.Docs) == 1 {
175 if m, ok := file.Docs[0].Body.(*ast.MappingNode); ok {
176 return m.Values[0].Key.GetToken().Position.Column - 1
177 }
178 }
179 return -1
180}
181
182func Completion(ctx context.Context, params *protocol.CompletionParams, manager *document.Manager, hub *hub.Service, doc document.ComposeDocument) (*protocol.CompletionList, error) {
183 documentPath, err := doc.DocumentPath()

Callers 1

CompletionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected