(full_text, text_before_cursor, statement)
| 170 | |
| 171 | |
| 172 | def _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 | |
| 185 | def _split_multiple_statements(full_text, text_before_cursor, parsed): |
no test coverage detected