mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Introduce SyntaxErrorKind and TextRange in SyntaxError
This commit is contained in:
parent
576b9a0727
commit
3b42ddae60
10 changed files with 159 additions and 68 deletions
|
@ -103,8 +103,8 @@ pub fn diagnostics(file: &File) -> Vec<Diagnostic> {
|
|||
file.errors()
|
||||
.into_iter()
|
||||
.map(|err| Diagnostic {
|
||||
range: TextRange::offset_len(err.offset, 1.into()),
|
||||
msg: "Syntax Error: ".to_string() + &err.msg,
|
||||
range: err.range,
|
||||
msg: format!("Syntax Error: {}", err.kind),
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue