package completion

import (
	
	
)

// Messages is a list of messages to be displayed
// below the input line, above completions. It is
// used to show usage and/or error status hints.
type Messages struct {
	messages map[string]bool
}

func ( *Messages) () {
	if .messages == nil {
		.messages = make(map[string]bool)
	}
}

// IsEmpty returns true if there are no messages to display.
func ( Messages) () bool {
	// TODO replacement for Action.skipCache - does this need to consider suppressed messages or is this fine?
	return len(.messages) == 0
}

// Add adds a message to the list of messages.
func ( *Messages) ( string) {
	.init()
	.messages[] = true
}

// Get returns the list of messages to display.
func ( Messages) () []string {
	 := make([]string, 0)
	for  := range .messages {
		 = append(, )
	}

	sort.Strings()

	return 
}

// Suppress removes messages matching the given regular expressions from the list of messages.
func ( *Messages) ( ...string) error {
	.init()

	for ,  := range  {
		,  := regexp.Compile()
		if  != nil {
			return 
		}

		for  := range .messages {
			if .MatchString() {
				delete(.messages, )
			}
		}
	}

	return nil
}

// Merge merges the given messages into the current list of messages.
func ( *Messages) ( Messages) {
	if .messages == nil {
		return
	}

	for  := range .messages {
		.Add()
	}
}