effekt-lang / effekt-lang/effekt

Add 'did you mean' help for typos in terms

Open
#1,166 1 comment 0 reactions 0 assignees View on GitHub
first-hackathon-issue quality-of-life
Dominant language
Scala
Stars
469
Forks
41
Avg merge
1d 16h
Merged PRs (30d)
23

Description

If the user makes a typo in a term (say, a field), we should try to offer a helpful correction instead of bailing.
```scala
record Person(name: String, age: Int)

val p = Person(...)

// examples
p.NamE // ~> Did you mean '.name'?
p.mame // ~> Did you mean '.name'?
p.namee // ~> Did you mean '.name'?
p.aeg // ~> Did you mean '.age'?
if (True) p.Show // ~> Did you mean 'true'? Did you mean 'show'?
```

A type-specific version of this is done in #1162, please see the changes there.

The code there should be reusable, though for things like fields / terms / functions, it might be helpful to have more than one recommendation (`.take(3)` instead of `.headOption`) and potentially tweak the heuristics a little bit.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.