Documentation
¶
Index ¶
- func GenerateErrorMessage(node *ts.Node, src string) (msg string, code rl.Error, suggestion *string)
- type Diagnostic
- func NewDiagnosticError(node *ts.Node, originalSrc string, msg string, code rl.Error) Diagnostic
- func NewDiagnosticErrorFromSpan(span rl.Span, originalSrc string, msg string, code rl.Error) Diagnostic
- func NewDiagnosticErrorWithSuggestion(node *ts.Node, originalSrc string, msg string, code rl.Error, ...) Diagnostic
- func NewDiagnosticFromNode(node *ts.Node, originalSrc string, severity Severity, msg string, ...) Diagnostic
- func NewDiagnosticFromSpan(span rl.Span, originalSrc string, severity Severity, msg string, ...) Diagnostic
- func NewDiagnosticHint(node *ts.Node, originalSrc string, msg string, code rl.Error) Diagnostic
- func NewDiagnosticHintFromSpan(span rl.Span, originalSrc string, msg string, code rl.Error) Diagnostic
- func NewDiagnosticWarn(node *ts.Node, originalSrc string, msg string, code rl.Error) Diagnostic
- func NewDiagnosticWarnFromSpan(span rl.Span, originalSrc string, msg string, code rl.Error) Diagnostic
- type Opts
- type Pos
- type RadChecker
- type RadCheckerImpl
- type Range
- type Result
- type Severity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Diagnostic ¶
type Diagnostic struct {
OriginalSrc string // Complete original src
Range Range
RangedSrc string // Src for just the Range
LineSrc string // Src for the line at the start of Range
Severity Severity
Message string
Code *rl.Error
Suggestion *string // Optional suggestion for fixing the error (rendered as "Try: ...")
}
Diagnostic represents a static analysis diagnostic. This is the canonical diagnostic type for the check system; both lsp.Diagnostic and core.Diagnostic are derived from it. Severity levels align with the LSP protocol (4 levels); core collapses Hint/Info into Note for its 3-level Rust-style CLI output.
func NewDiagnosticError ¶
func NewDiagnosticErrorFromSpan ¶ added in v0.9.0
func NewDiagnosticErrorWithSuggestion ¶ added in v0.6.26
func NewDiagnosticFromNode ¶
func NewDiagnosticFromSpan ¶ added in v0.9.0
func NewDiagnosticFromSpan( span rl.Span, originalSrc string, severity Severity, msg string, code *rl.Error, ) Diagnostic
NewDiagnosticFromSpan creates a Diagnostic from an AST span instead of a CST node.
func NewDiagnosticHint ¶ added in v0.6.15
func NewDiagnosticHintFromSpan ¶ added in v0.9.0
func NewDiagnosticWarn ¶ added in v0.6.17
func NewDiagnosticWarnFromSpan ¶ added in v0.9.0
type RadChecker ¶
type RadChecker interface {
UpdateSrc(src string)
Update(tree *rts.RadTree, src string, ast *rl.SourceFile)
CheckDefault() (Result, error)
Check(Opts) (Result, error)
}
func NewChecker ¶
func NewChecker() (RadChecker, error)
func NewCheckerWithTree ¶
func NewCheckerWithTree(tree *rts.RadTree, parser *rts.RadParser, src string, ast *rl.SourceFile) RadChecker
type RadCheckerImpl ¶
type RadCheckerImpl struct {
// contains filtered or unexported fields
}
func (*RadCheckerImpl) Check ¶
func (c *RadCheckerImpl) Check(opts Opts) (Result, error)
todo use opts
func (*RadCheckerImpl) CheckDefault ¶
func (c *RadCheckerImpl) CheckDefault() (Result, error)
func (*RadCheckerImpl) Update ¶ added in v0.9.0
func (c *RadCheckerImpl) Update(tree *rts.RadTree, src string, ast *rl.SourceFile)
func (*RadCheckerImpl) UpdateSrc ¶
func (c *RadCheckerImpl) UpdateSrc(src string)
type Result ¶
type Result struct {
// todo Rad versions
Diagnostics []Diagnostic
}
Click to show internal directories.
Click to hide internal directories.