(_ context.Context, _ base.DiagnoseContext, statement string)
| 13 | } |
| 14 | |
| 15 | func Diagnose(_ context.Context, _ base.DiagnoseContext, statement string) ([]base.Diagnostic, error) { |
| 16 | diagnostics := make([]base.Diagnostic, 0) |
| 17 | _, err := ParseTiDB(statement, "", "") |
| 18 | var syntaxError *base.SyntaxError |
| 19 | if err != nil { |
| 20 | if errors.As(err, &syntaxError) { |
| 21 | diagnostics = append(diagnostics, base.ConvertSyntaxErrorToDiagnostic(syntaxError, statement)) |
| 22 | } else { |
| 23 | return nil, err |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | return diagnostics, nil |
| 28 | } |
nothing calls this directly
no test coverage detected