MCPcopy Create free account
hub / github.com/bytebase/bytebase / Completion

Function Completion

backend/plugin/parser/mysql/completion.go:28–40  ·  view source on GitHub ↗
(ctx context.Context, cCtx base.CompletionContext, statement string, caretLine int, caretOffset int)

Source from the content-addressed store, hash-verified

26}
27
28func Completion(ctx context.Context, cCtx base.CompletionContext, statement string, caretLine int, caretOffset int) ([]base.Candidate, error) {
29 completer := NewStandardCompleter(ctx, cCtx, statement, caretLine, caretOffset)
30 result, err := completer.completion()
31 if err != nil {
32 return nil, err
33 }
34 if len(result) > 0 {
35 return result, nil
36 }
37
38 trickyCompleter := NewTrickyCompleter(ctx, cCtx, statement, caretLine, caretOffset)
39 return trickyCompleter.completion()
40}
41
42func computeSQLAndByteOffset(statement string, caretLine int, caretOffset int, tricky bool) (string, int) {
43 var sql string

Callers

nothing calls this directly

Calls 3

NewStandardCompleterFunction · 0.70
NewTrickyCompleterFunction · 0.70
completionMethod · 0.45

Tested by

no test coverage detected