Completion returns the completion candidates for the statement.
(ctx context.Context, engine storepb.Engine, cCtx CompletionContext, statement string, caretLine int, caretOffset int)
| 149 | |
| 150 | // Completion returns the completion candidates for the statement. |
| 151 | func Completion(ctx context.Context, engine storepb.Engine, cCtx CompletionContext, statement string, caretLine int, caretOffset int) ([]Candidate, error) { |
| 152 | f, ok := completers[engine] |
| 153 | if !ok { |
| 154 | return nil, errors.Errorf("engine %s is not supported", engine) |
| 155 | } |
| 156 | return f(ctx, cCtx, statement, caretLine, caretOffset) |
| 157 | } |
| 158 | |
| 159 | // RegisterDiagnoseFunc registers the diagnose function for the engine. |
| 160 | func RegisterDiagnoseFunc(engine storepb.Engine, f DiagnoseFunc) { |