Simplify repl tips

This commit is contained in:
Richard Feldman 2023-09-18 11:53:22 -04:00
parent 2bf6dd9b18
commit 1f396871f9
No known key found for this signature in database
GPG Key ID: F1F21AA5B1D9E43B
4 changed files with 18 additions and 15 deletions

View File

@ -1,21 +1,20 @@
//! Command Line Interface (CLI) functionality for the Read-Evaluate-Print-Loop (REPL).
mod cli_gen;
use std::borrow::Cow;
use bumpalo::Bump;
use const_format::concatcp;
use roc_load::MonomorphizedModule;
use roc_mono::ir::OptLevel;
use roc_repl_eval::gen::Problems;
use roc_repl_ui::colors::{BLUE, END_COL, PINK};
use roc_repl_ui::repl_state::{ReplAction, ReplState};
use roc_repl_ui::{
format_output, is_incomplete, CONT_PROMPT, PROMPT, SHORT_INSTRUCTIONS, TIPS, WELCOME_MESSAGE,
};
use roc_repl_ui::{format_output, is_incomplete, CONT_PROMPT, PROMPT, SHORT_INSTRUCTIONS, TIPS};
use roc_reporting::report::{ANSI_STYLE_CODES, DEFAULT_PALETTE};
use roc_target::TargetInfo;
use rustyline::highlight::{Highlighter, PromptInfo};
use rustyline::validate::{self, ValidationContext, ValidationResult, Validator};
use rustyline_derive::{Completer, Helper, Hinter};
use std::borrow::Cow;
use target_lexicon::Triple;
use crate::cli_gen::eval_llvm;

View File

@ -1408,10 +1408,8 @@ fn interpolation_with_nested_interpolation() {
Tips:
- ctrl-v + ctrl-j makes a newline
- :q to quit
- :help"#
- :help shows this text again"#
),
// TODO figure out why the tests prints the repl help text at the end, but only after syntax errors or something?
// In the actual repl this doesn't happen, only in the test.

View File

@ -11,13 +11,15 @@ use roc_parse::ast::{Expr, ValueDef};
use roc_repl_eval::gen::{Problems, ReplOutput};
use roc_reporting::report::StyleCodes;
use crate::colors::GREEN;
// TODO add link to repl tutorial(does not yet exist).
pub const TIPS: &str = concatcp!(
"\nEnter an expression to evaluate, or a definition (like ",
BLUE,
"x = 1",
END_COL,
") to use later.\n\nTips:\n\n",
") to use later.\n\n",
if cfg!(target_family = "wasm") {
// In the web REPL, the :quit command doesn't make sense. Just close the browser tab!
// We use Shift-Enter for newlines because it's nicer than our workaround for Unix terminals (see below)
@ -51,15 +53,21 @@ pub const TIPS: &str = concatcp!(
PINK,
"ctrl-j",
END_COL,
" makes a newline\n\n",
" makes a newline\n",
BLUE,
" - ",
END_COL,
":q to quit\n\n",
GREEN,
":q",
END_COL,
" quits\n",
BLUE,
" - ",
END_COL,
":help"
GREEN,
":help",
END_COL,
" shows this text again\n",
)
}
);

View File

@ -72,9 +72,7 @@ li {
}
#history-text {
margin: 16px 0;
padding: 8px;
padding-bottom: 0;
margin-top: 16px;
}
#loading-message {