This test checks various ranking of completion results related to printf.

-- flags --
-ignore_extra_diags

-- printf.go --
package printf

import "fmt"

func myPrintf(string, ...any) {}

func _() {
	var (
		aInt      int          //@item(printfInt, "aInt", "int", "var")
		aFloat    float64      //@item(printfFloat, "aFloat", "float64", "var")
		aString   string       //@item(printfString, "aString", "string", "var")
		aBytes    []byte       //@item(printfBytes, "aBytes", "[]byte", "var")
		aStringer fmt.Stringer //@item(printfStringer, "aStringer", "fmt.Stringer", "var")
		aError    error        //@item(printfError, "aError", "error", "var")
		aBool     bool         //@item(printfBool, "aBool", "bool", "var")
	)

	myPrintf("%d", a)       //@rank(re"()\\)", printfInt, printfFloat)
	myPrintf("%s", a)       //@rank(re"()\\)", printfString, printfInt),rank(re"()\\)", printfBytes, printfInt),rank(re"()\\)", printfStringer, printfInt),rank(re"()\\)", printfError, printfInt)
	myPrintf("%w", a)       //@rank(re"()\\)", printfError, printfInt)
	myPrintf("%x %[1]b", a) //@rank(re"()\\)", printfInt, printfString)

	fmt.Printf("%t", a) //@rank(re"()\\)", printfBool, printfInt)

	fmt.Fprintf(nil, "%f", a) //@rank(re"()\\)", printfFloat, printfInt)

	fmt.Sprintf("%[2]q %[1]*.[3]*[4]f",
		a, //@rank(re"(),", printfInt, printfFloat)
		a, //@rank(re"(),", printfString, printfFloat)
		a, //@rank(re"(),", printfInt, printfFloat)
		a, //@rank(re"(),", printfFloat, printfInt)
	)

  // Don't insert as "&aStringer"
	fmt.Printf("%p", a) //@snippet(re"()\\)", printfStringer, "aStringer")
}
