MCPcopy Index your code
hub / github.com/dbcli/pgcli / _statement_from_function

Function _statement_from_function

pgcli/packages/sqlcompletion.py:172–182  ·  view source on GitHub ↗
(full_text, text_before_cursor, statement)

Source from the content-addressed store, hash-verified

170
171
172def _statement_from_function(full_text, text_before_cursor, statement):
173 current_pos = len(text_before_cursor)
174 body_start, body_end = _find_function_body(full_text)
175 if body_start is None:
176 return full_text, text_before_cursor, statement
177 if not body_start <= current_pos < body_end:
178 return full_text, text_before_cursor, statement
179 full_text = full_text[body_start:body_end]
180 text_before_cursor = text_before_cursor[body_start:]
181 parsed = sqlparse.parse(text_before_cursor)
182 return _split_multiple_statements(full_text, text_before_cursor, parsed)
183
184
185def _split_multiple_statements(full_text, text_before_cursor, parsed):

Callers 1

Calls 2

_find_function_bodyFunction · 0.85

Tested by

no test coverage detected