package xonsh

import (
	
	
	

	
)

var sanitizer = strings.NewReplacer( // TODO
	"\n", ``,
	"\t", ``,
	`'`, `\'`,
)

type richCompletion struct {
	Value       string
	Display     string
	Description string
}

// ActionRawValues formats values for xonsh.
func ( string,  common.Meta,  common.RawValues) string {
	 := make([]richCompletion, len())
	for ,  := range  {
		.Value = sanitizer.Replace(.Value)

		if strings.ContainsAny(.Value, ` ()[]{}*$?\"|<>&;#`+"`") {
			if strings.Contains(.Value, `\`) {
				.Value = fmt.Sprintf("r'%v'", .Value) // backslash needs raw string
			} else {
				.Value = fmt.Sprintf("'%v'", .Value)
			}
		}

		if !.Nospace.Matches(.Value) {
			.Value = .Value + " "
		}

		[] = richCompletion{Value: .Value, Display: .Display, Description: .TrimmedDescription()}
	}
	,  := json.Marshal()
	return string()
}