wgsl: Do not make error output colorful when the terminal is dumb

This commit is contained in:
rhysd
2022-01-29 21:31:06 +09:00
committed by Dzmitry Malyshau
parent f98053aa3c
commit d6f8958b34

View File

@@ -1181,7 +1181,7 @@ impl ParseError {
pub fn emit_to_stderr_with_path(&self, source: &str, path: &str) {
let files = SimpleFile::new(path, source);
let config = codespan_reporting::term::Config::default();
let writer = StandardStream::stderr(ColorChoice::Always);
let writer = StandardStream::stderr(ColorChoice::Auto);
term::emit(&mut writer.lock(), &config, &files, &self.diagnostic())
.expect("cannot write error");
}