-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(consoleapp) Add /help command #284
Conversation
standardOutputHandler($"Perlang Interactive REPL Console ({CommonConstants.GetFullVersion()}, built from git commit {CommonConstants.GitCommit})"); | ||
standardOutputHandler($"Perlang Interactive REPL Console (\x1B[1m{CommonConstants.GetFullVersion()}\x1B[0m, built from git commit {CommonConstants.GitCommit})"); | ||
standardOutputHandler("Type \x1B[36;1m/help\x1B[0m for more information or \x1B[36;1m/quit\x1B[0m to quit the program."); | ||
standardOutputHandler(String.Empty); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The careful reader will notice that this makes quite heavy use of ANSI colouring sequences. This should even work on Windows nowadays, as of Windows 10 version 1909 (released in November 2019). I haven't verified it, but will test it at some point after merging this.
The REPL is always expected to be executed in "interactive" mode, but we should probably try to auto-detect the support for colour at some point. Or at the very least, add a --[no-]color
option to be able to turn it on or off.
(Side note, but I know I might seem completely inconsistent with the "color" vs "colour" usage above. but I'm not sure I really am. I think that --color
makes more sense as a command line option, since more people are likely to expect the Americanized spelling of this word. At the same time, I think I learned the British spellings in school (in Sweden where I grew up), and I kind of like it better for some odd reason. It feels more colourful or something... 😏)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -487,6 +517,7 @@ public string[] GetSuggestions(string text, int index) | |||
{ | |||
var matchingKeywords = Scanner.ReservedKeywords | |||
.Where(keyword => keyword.Key.StartsWith(text)) | |||
.Where(keyword => keyword.Value != TokenType.RESERVED_WORD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Drive-by-fix: the reserved words doesn't make any sense to include in the GetSuggestions
reuslt, since they are just "reserved for future use" in that sense.)
Closes #212.