stdlib-js / stdlib-js/stdlib

[RFC]: add support for displaying suggested corrections in the REPL

Offen
#2,058 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
difficulty: 3 Enhancement JavaScript Needs Discussion priority: Normal REPL RFC
Vorherrschende Sprache
JavaScript
Sterne
6k
Forks
1.3k
Ø Merge
1 T. 3 Std.
Gemergte PRs (30 T.)
611

Beschreibung

### Description

This RFC proposes adding support for displaying suggested corrections in the REPL when a user enters an identifier which does not exist. This functionality would be similar to what is offered by Julia and discussed in https://github.com/JuliaLang/julia/issues/28347.

For example, currently, when a user enters an undefined identifier

```
In [1]: base.abbs( -1.0 )
Error: base.abbs is not a function
```

This RFC proposes extending this to do something along the lines of

```
In [1]: base.abbs( -1.0 )
Error: base.abbs is not a function

Perhaps you meant base.abs, base.abs2, ...
```

There may be other UI options, and we could, similar to Julia, provide suggestions when a user provides an unknown name to `help()` (or other similar built-in REPL commands).

### Related Issues

No.

### Questions

No.

### Other

No.

### Checklist

- [X] I have read and understood the [Code of Conduct](https://github.com/stdlib-js/stdlib/blob/develop/CODE_OF_CONDUCT.md).
- [X] Searched for existing issues and pull requests.
- [X] The issue name begins with `RFC:`.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.