Bring attention to suggestions when the only difference is capitalization

This commit is contained in:
Esteban Küber
2019-10-13 21:48:39 -07:00
parent 898f36c83c
commit 4bb771615e
38 changed files with 121 additions and 71 deletions

View File

@@ -12,7 +12,7 @@
use crate::source_map::{SourceMap, FilePathMapping};
use errors::registry::Registry;
use errors::{SubDiagnostic, CodeSuggestion, SourceMapper};
use errors::{SubDiagnostic, CodeSuggestion, SourceMapper, SourceMapperDyn};
use errors::{DiagnosticId, Applicability};
use errors::emitter::{Emitter, HumanReadableErrorType};
@@ -113,6 +113,10 @@ impl Emitter for JsonEmitter {
}
}
fn source_map(&self) -> Option<&Lrc<SourceMapperDyn>> {
Some(&self.sm)
}
fn should_show_explain(&self) -> bool {
match self.json_rendered {
HumanReadableErrorType::Short(_) => false,