MCPcopy Index your code
hub / github.com/bytebase/bytebase / computeSQLAndByteOffset

Function computeSQLAndByteOffset

backend/plugin/parser/tsql/completion.go:502–508  ·  view source on GitHub ↗
(statement string, caretLine int, caretOffset int, tricky bool)

Source from the content-addressed store, hash-verified

500}
501
502func computeSQLAndByteOffset(statement string, caretLine int, caretOffset int, tricky bool) (string, int) {
503 sql, newLine, newOffset := skipHeadingSQLs(statement, caretLine, caretOffset)
504 if tricky {
505 sql, newLine, newOffset = skipHeadingSQLWithoutSemicolon(sql, newLine, newOffset)
506 }
507 return sql, lineColumnToByteOffset(sql, newLine, newOffset)
508}
509
510func lineColumnToByteOffset(sql string, line, column int) int {
511 currentLine := 1

Callers 2

NewStandardCompleterFunction · 0.70
NewTrickyCompleterFunction · 0.70

Calls 3

skipHeadingSQLsFunction · 0.70
lineColumnToByteOffsetFunction · 0.70

Tested by

no test coverage detected