Skip to content

lang: parser/eval error messages violate the progressive-guidance principle #452

Description

@pskry

Found while writing negative goldens for #446 - the new parse/errors and eval/errors_runtime fixtures pin these messages as-is, so improving them means updating goldens (by design: the fixtures are regression anchors for message quality).

  1. Parser messages leak internal token names, redundantly: expected RBrace in type body (expected RBrace, got EOF) and expected Colon in field type annotation. Users should see } / : once, not Go token identifiers twice.

  2. The classic : vs = mixup gets no nudge: name: "web" inside a struct literal yields only expected expression, got Colon. This is THE most common syntax confusion for anyone coming from JSON/YAML - it deserves a targeted hint ("struct literal fields use =, e.g. name = "web"") per the core error-UX principle.

  3. for-in requires a list does not say what type it got and has no hint.

Error messages are self-documenting and guiding - a user should reach a valid config by following them alone. These three fall short of that bar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    impact/highChanges what the tool can do, unlocks new use caseskind/enhancementImprove existing functionality

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions