mirror of
https://github.com/Myzel394/config-lsp.git
synced 2025-06-18 23:15:26 +02:00
32 lines
563 B
Go
32 lines
563 B
Go
package common
|
|
|
|
import (
|
|
protocol "github.com/tliron/glsp/protocol_3_16"
|
|
)
|
|
|
|
type ParseError struct {
|
|
Line uint32
|
|
Err error
|
|
}
|
|
|
|
func (e ParseError) Error() string {
|
|
return "Parse error"
|
|
}
|
|
func (e ParseError) ToDiagnostic() protocol.Diagnostic {
|
|
severity := protocol.DiagnosticSeverityError
|
|
return protocol.Diagnostic{
|
|
Severity: &severity,
|
|
Message: e.Err.Error(),
|
|
Range: protocol.Range{
|
|
Start: protocol.Position{
|
|
Line: e.Line,
|
|
Character: 0,
|
|
},
|
|
End: protocol.Position{
|
|
Line: e.Line,
|
|
Character: 999999,
|
|
},
|
|
},
|
|
}
|
|
}
|