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

Function findCaretTokenIndex

backend/plugin/parser/mysql/completion.go:142–149  ·  view source on GitHub ↗
(tokens []mysqlparser.Token, byteOffset int)

Source from the content-addressed store, hash-verified

140}
141
142func findCaretTokenIndex(tokens []mysqlparser.Token, byteOffset int) int {
143 for i, tok := range tokens {
144 if tok.Loc >= byteOffset {
145 return i
146 }
147 }
148 return len(tokens)
149}
150
151func (c *Completer) completion() ([]base.Candidate, error) {
152 // Check if the caret is inside or at the start of a backtick-quoted identifier.

Callers 2

NewStandardCompleterFunction · 0.70
NewTrickyCompleterFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected