stdlib-js / stdlib-js/stdlib

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

Đang mở
#2,058 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
difficulty: 3 Enhancement JavaScript Needs Discussion priority: Normal REPL RFC
Ngôn ngữ chính
JavaScript
Star
6k
Fork
1.3k
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
611

Mô tả

### 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:`.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start by reviewing the REPL behavior described in this RFC and the linked Julia discussion. The proposal does not identify files, tests, or a settled UI; scope would need to be clarified before implementation. Done would mean agreeing on and implementing a way to suggest corrections for undefined identifiers, with possible support for unknown names passed to help().

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript
Lĩnh vực
cli
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
20/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.