mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-30 21:01:10 +00:00
Update error.rs
This commit is contained in:
parent
bc50ceeb6a
commit
fc976d38c5
1 changed files with 14 additions and 0 deletions
|
@ -916,6 +916,20 @@ impl ErrorCore {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn hints(&self) -> Vec<&str> {
|
||||||
|
self.sub_messages
|
||||||
|
.iter()
|
||||||
|
.filter_map(|sub| sub.hint.as_deref())
|
||||||
|
.collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn mut_hints(&mut self) -> Vec<&mut String> {
|
||||||
|
self.sub_messages
|
||||||
|
.iter_mut()
|
||||||
|
.filter_map(|sub| sub.hint.as_mut())
|
||||||
|
.collect()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn fmt_header(&self, color: Color, caused_by: &str, input: &str) -> String {
|
pub fn fmt_header(&self, color: Color, caused_by: &str, input: &str) -> String {
|
||||||
let loc = match self.loc {
|
let loc = match self.loc {
|
||||||
Location::Range {
|
Location::Range {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue