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

Function statementIndexAtCaret

backend/plugin/parser/tsql/completion.go:1698–1707  ·  view source on GitHub ↗
(list []base.Statement, caretLine int, caretOffset int)

Source from the content-addressed store, hash-verified

1696}
1697
1698func statementIndexAtCaret(list []base.Statement, caretLine int, caretOffset int) int {
1699 for i, statement := range list {
1700 endLine := int(statement.End.GetLine()) - 1
1701 endColumn := int(statement.End.GetColumn())
1702 if endLine > caretLine || (endLine == caretLine && endColumn >= caretOffset) {
1703 return i
1704 }
1705 }
1706 return 0
1707}
1708
1709func rebaseCaretAfterSkippedStatement(previous base.Statement, caretLine int, caretOffset int) (int, int) {
1710 previousEndLine := int(previous.End.GetLine()) - 1

Callers 1

skipHeadingSQLsFunction · 0.85

Calls 2

GetLineMethod · 0.45
GetColumnMethod · 0.45

Tested by

no test coverage detected