FormatErrorWithSuggestions formats an error message with actionable suggestions
(message string, suggestions []string)
| 763 | |
| 764 | // FormatErrorWithSuggestions formats an error message with actionable suggestions |
| 765 | func FormatErrorWithSuggestions(message string, suggestions []string) string { |
| 766 | var output strings.Builder |
| 767 | output.WriteString(FormatErrorMessage(message)) |
| 768 | |
| 769 | if len(suggestions) > 0 { |
| 770 | output.WriteString("\n\nSuggestions:\n") |
| 771 | for _, suggestion := range suggestions { |
| 772 | output.WriteString(" • " + suggestion + "\n") |
| 773 | } |
| 774 | } |
| 775 | |
| 776 | return output.String() |
| 777 | } |
| 778 | |
| 779 | // findWordEnd finds the end of a word starting at the given position |
| 780 | func findWordEnd(line string, start int) int { |