Skip to content
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

Config::default().with_color(false) not disable colors for with_message #120

Open
Young-Flash opened this issue Jul 8, 2024 · 0 comments

Comments

@Young-Flash
Copy link

Young-Flash commented Jul 8, 2024

Thanks for th great project

There is a issue which similar to #54

Config::default().with_color(false) don't work for 1

let mut report_builder =
    ariadne::Report::build(kind, source_file_path, self.location.start.offset as usize)
        .with_code(self.error_code)
        .with_message(&self.message)
        .with_label(
            ariadne::Label::new((
                source_file_path,
                self.location.start.offset as usize..self.location.end.offset as usize,
            ))
            .with_message((&self.message).fg(color)) //  <-------- 1
            .with_color(color),
        );

if !use_fancy {
    let config = ariadne::Config::default().with_color(false);
    report_builder = report_builder.with_config(config);
}

report_builder
    .finish()
    .print((source_file_path, ariadne::Source::from(source_file)))
    .unwrap();

I'd like to help fix this if you guys consider this is indeed a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant