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

Function findCaretTokenIndex

backend/plugin/parser/tsql/completion.go:531–538  ·  view source on GitHub ↗
(tokens []mssqlparser.Token, byteOffset int)

Source from the content-addressed store, hash-verified

529}
530
531func findCaretTokenIndex(tokens []mssqlparser.Token, byteOffset int) int {
532 for i, tok := range tokens {
533 if tok.Loc >= byteOffset {
534 return i
535 }
536 }
537 return len(tokens)
538}
539
540// caretLine is 1-based and caretOffset is 0-based.
541func skipHeadingSQLWithoutSemicolon(statement string, caretLine int, caretOffset int) (string, int, int) {

Callers 1

newCompleterFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected