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

Method prefixToken

backend/plugin/parser/mysql/completion.go:198–213  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

196}
197
198func (c *Completer) prefixToken() (mysqlparser.Token, bool) {
199 idx := c.caretTokenIndex
200 if idx < len(c.tokens) {
201 tok := c.tokens[idx]
202 if tok.Loc < c.cursorByteOffset && c.cursorByteOffset <= tok.End && mysqlparser.IsIdentTokenType(tok.Type) {
203 return tok, true
204 }
205 }
206 if idx > 0 {
207 tok := c.tokens[idx-1]
208 if tok.End == c.cursorByteOffset && mysqlparser.IsIdentTokenType(tok.Type) {
209 return tok, true
210 }
211 }
212 return mysqlparser.Token{}, false
213}
214
215type CompletionMap map[string]base.Candidate
216

Callers 1

completionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected