mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 16:35:29 +02:00
Add parser tracing, fix 629 (#638)
This commit is contained in:
@ -15,3 +15,4 @@ nu-color-config = { path = "../nu-color-config" }
|
||||
miette = { version = "3.0.0", features = ["fancy"] }
|
||||
thiserror = "1.0.29"
|
||||
reedline = { git = "https://github.com/nushell/reedline", branch = "main" }
|
||||
log = "0.4"
|
@ -1,3 +1,4 @@
|
||||
use log::trace;
|
||||
use nu_ansi_term::Style;
|
||||
use nu_color_config::get_shape_color;
|
||||
use nu_parser::{flatten_block, parse, FlatShape};
|
||||
@ -12,6 +13,8 @@ pub struct NuHighlighter {
|
||||
|
||||
impl Highlighter for NuHighlighter {
|
||||
fn highlight(&self, line: &str) -> StyledText {
|
||||
trace!("highlighting: {}", line);
|
||||
|
||||
let (shapes, global_span_offset) = {
|
||||
let mut working_set = StateWorkingSet::new(&self.engine_state);
|
||||
let (block, _) = parse(&mut working_set, None, line.as_bytes(), false);
|
||||
|
Reference in New Issue
Block a user