Improve Error Reporting: FSI: support for help/quitting/exiting
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 131
Description
It’s not intuitive for new users to remember to add hashtag in front of commands in FSI.
**Current situation:**
```
help;;
error FS0039: The value or constructor 'help' is not defined.
```
```
quit;;
error FS0039: The value or constructor 'quit' is not defined.
```
```
#exit;;
warning FS3353: Invalid directive '#exit
```
```
exit;;
val it: (int -> 'a)
```
**Why?**
I think these commands are something that any newcomer to FSI might try and be a little discouraged by the results.
I would propose to add this messages to aid users
For example python after quit and exit displays this message:
```
quit
Use exit() or Ctrl-D (i.e. EOF) to exit
```
**Proposed solution:**
This is my general idea (might need to correct the grammar, spacing, etc.)
```
help;;
error FS0039: The value or constructor 'help' is not defined.
Did you mean #help;; ?
```
```
quit;;
error FS0039: The value or constructor 'quit' is not defined.
Use #quit;; or Ctrl-D to exit
```
```
#exit;;
warning FS3353: Invalid directive '#exit
Use #quit;; or Ctrl-D to exit
```
This one is more problematic to give good solution, but here is my attempt:
```
exit;;
val it: (int -> 'a)
Use exit 0;; #quit;; or Ctrl-D to exit
```
Of course all of them should only happen if you have not defined your own functions named help or quit.
**Additional info**
I just recently discovered F# and I did typed all of these repeatedly until I learned. I tried this experiment on my C# coworkers (type _dotnet fsi_ and try to exit without using help) and most of them struggled until finally being able to exit with _Ctrl+D_ or _Ctrl+Z_ .
Contributor guide
Assessment
This issue has not been assessed yet.