in internal/langserver/handlers/snippets/snippets_gen.go [103:142]
func placeholderContent(content string, typeMap map[string]string) string {
out := "TODO"
parts := strings.Split(content, ".")
if len(parts) == 0 {
return out
}
lastPart := parts[len(parts)-1]
if lastPart == "subscription_id" {
return "subscription id"
}
if lastPart == "tenant_id" {
return "tenant id"
}
if lastPart == "output" {
return out
}
switch parts[0] {
case "var":
if lastPart == "resource_name" {
return "The name of the resource"
}
return lastPart
case "local":
return lastPart
case "data":
addr := strings.Join(parts[:len(parts)-1], ".")
if typeValue, ok := typeMap[addr]; ok {
return fmt.Sprintf("The %s of the %s resource", lastPart, typeValue)
}
case "azapi_resource", "azapi_resource_action", "azapi_update_resource":
addr := strings.Join(parts[:len(parts)-1], ".")
if len(parts) == 2 {
addr = content
}
if typeValue, ok := typeMap[addr]; ok {
return fmt.Sprintf("The %s of the %s resource", lastPart, typeValue)
}
}
return out
}