feat: help for misspelled pipes is now shown to the user.

This commit is contained in:
Spencer Brower
2026-07-31 09:14:34 -04:00
parent 0d09db8d26
commit 9e93c012b6
4 changed files with 31 additions and 1 deletions
+6
View File
@@ -259,11 +259,17 @@ resolve_format_string :: proc(name: string, ctx: []any, pos: int) -> (string, Er
apply_filter :: proc(value: any, filter: ^Pipe_Filter, pos: int, ctx: []any) -> (any, Error) {
op, ok := pipe_op_from_string(filter.op)
if !ok {
hint := ""
suggestion := suggest_correction(pipe_op_candidates(), filter.op)
if suggestion != "" {
hint = fmt.tprintf("did you mean '%s'?", suggestion)
}
return nil, Error_Body {
msg = fmt.tprintf("unknown pipe op '%s'", filter.op),
pos = filter.op_pos,
span = len(filter.op),
kind = .Data,
hint = hint,
}
}