func GetBlockAttributeCompletions()

in internal/langserver/handlers/complete_v2.go [97:123]


func GetBlockAttributeCompletions(resourceName, path string) []protocol.CompletionItem {
	props, err := provider_schema.ListDirectProperties(resourceName, path)
	if err != nil {
		return nil
	}

	var items []protocol.CompletionItem
	for _, p := range props {
		content, prop, err := provider_schema.GetAttributeContent(resourceName, p.AttributePath)
		if err != nil || prop == nil {
			continue
		}

		items = append(items, protocol.CompletionItem{
			Label:      fmt.Sprintf("☁️(property) %s (%s)", p.Name, prop.GetRequirementType()),
			Kind:       protocol.SnippetCompletion,
			SortText:   p.GetSortOrder(),
			Detail:     "Property Info",
			InsertText: p.Name,
			Documentation: protocol.MarkupContent{
				Kind:  protocol.Markdown,
				Value: content,
			},
		})
	}
	return items
}