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

Function computeSQLAndByteOffset

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

Source from the content-addressed store, hash-verified

83}
84
85func computeSQLAndByteOffset(statement string, caretLine int, caretOffset int, tricky bool) (string, int) {
86 sql, newLine, newOffset := skipHeadingSQLs(statement, caretLine, caretOffset)
87 if tricky {
88 sql, newLine, newOffset = skipHeadingSQLWithoutSemicolon(sql, newLine, newOffset)
89 }
90 return sql, lineColumnToByteOffset(sql, newLine, newOffset)
91}
92
93func lineColumnToByteOffset(sql string, line, column int) int {
94 currentLine := 1

Callers 3

NewStandardCompleterFunction · 0.70
NewTrickyCompleterFunction · 0.70

Calls 3

skipHeadingSQLsFunction · 0.70
lineColumnToByteOffsetFunction · 0.70

Tested by 1