(file *ast.File)
| 171 | } |
| 172 | |
| 173 | func 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 | |
| 182 | func Completion(ctx context.Context, params *protocol.CompletionParams, manager *document.Manager, hub *hub.Service, doc document.ComposeDocument) (*protocol.CompletionList, error) { |
| 183 | documentPath, err := doc.DocumentPath() |