Skip to content

Improve Not Found error messages in EO compiler #4520

@skulidropek

Description

@skulidropek

Current error:

Couldn't find object 'Φ.org.eolang.io.std1out' because there's no class or package 'EOorg.EOeolang.EOio.EOstd1out'
EOorg.EOeolang.EOio.EOstd1out

Required behavior:

  • Keep the original compiler message.
  • Add a Did you mean? section with top-5 closest matches.
  • Suggestions should be based on Word Match, Partial Match, and Levenshtein Distance.

Example:

Couldn't find object 'Φ.org.eolang.io.std1out' because there's no class or package 'EOorg.EOeolang.EOio.EOstd1out'
EOorg.EOeolang.EOio.EOstd1out

Did you mean?
  - org.eolang.io.stdout
  - org.eolang.txt.sprintf
  - org.eolang.txt.text
  - org.eolang.txt.trim
  - org.eolang.txt.concat

Result:
Every Not Found error provides immediate corrective feedback instead of leaving the user with a dead end.

Ready example for TypeScript:
https://github.com/ton-ai-core/eslint-plugin-suggest-members

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    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