feat: publish errors as lsp diagnostic messages

This commit is contained in:
rvcas
2022-11-15 17:15:58 -05:00
committed by Lucas
parent f089eff97d
commit bff99b0cf2
10 changed files with 366 additions and 32 deletions

View File

@@ -77,6 +77,7 @@ pub enum ErrorKind {
#[error("unclosed {start}")]
Unclosed {
start: Pattern,
#[label]
before_span: Span,
before: Option<Pattern>,
},

View File

@@ -55,7 +55,9 @@ pub enum Error {
#[error("duplicate type name {name}")]
DuplicateTypeName {
#[label]
location: Span,
#[label]
previous_location: Span,
name: String,
},
@@ -79,6 +81,7 @@ pub enum Error {
#[error("{name} has incorrect type arity expected {expected} but given {given}")]
IncorrectTypeArity {
#[label]
location: Span,
name: String,
expected: usize,