mirror of
https://github.com/denoland/deno.git
synced 2025-01-21 21:50:00 -05:00
fix(repl): highlight from ident in import from or export from (#20023)
This commit is contained in:
parent
029bdf0cd5
commit
e8d03119a0
1 changed files with 9 additions and 0 deletions
|
@ -389,6 +389,15 @@ impl Highlighter for EditorHelper {
|
|||
// We're looking for something that looks like a function
|
||||
// We use a simple heuristic: 'ident' followed by 'LParen'
|
||||
colors::intense_blue(&line[range]).to_string()
|
||||
} else if ident == *"from"
|
||||
&& matches!(
|
||||
next,
|
||||
Some(deno_ast::TokenOrComment::Token(Token::Str { .. }))
|
||||
)
|
||||
{
|
||||
// When ident 'from' is followed by a string literal, highlight it
|
||||
// E.g. "export * from 'something'" or "import a from 'something'"
|
||||
colors::cyan(&line[range]).to_string()
|
||||
} else {
|
||||
line[range].to_string()
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue