MCPcopy Create free account
hub / github.com/dbcli/mssql-cli / _statement_from_function

Function _statement_from_function

mssqlcli/packages/sqlcompletion.py:186–196  ·  view source on GitHub ↗
(full_text, text_before_cursor, statement)

Source from the content-addressed store, hash-verified

184
185
186def _statement_from_function(full_text, text_before_cursor, statement):
187 current_pos = len(text_before_cursor)
188 body_start, body_end = _find_function_body(full_text)
189 if body_start is None:
190 return full_text, text_before_cursor, statement
191 if not body_start <= current_pos < body_end:
192 return full_text, text_before_cursor, statement
193 full_text = full_text[body_start:body_end]
194 text_before_cursor = text_before_cursor[body_start:]
195 parsed = sqlparse.parse(text_before_cursor)
196 return _split_multiple_statements(full_text, text_before_cursor, parsed)
197
198
199def _split_multiple_statements(full_text, text_before_cursor, parsed):

Callers 1

Calls 2

_find_function_bodyFunction · 0.85

Tested by

no test coverage detected