If after a dot, the attribute being completed
(
cursor_offset: int, line: str
)
| 272 | |
| 273 | |
| 274 | def current_expression_attribute( |
| 275 | cursor_offset: int, line: str |
| 276 | ) -> LinePart | None: |
| 277 | """If after a dot, the attribute being completed""" |
| 278 | # TODO replace with more general current_expression_attribute |
| 279 | for m in _current_expression_attribute_re.finditer(line): |
| 280 | if m.start(1) <= cursor_offset <= m.end(1): |
| 281 | return LinePart(m.start(1), m.end(1), m.group(1)) |
| 282 | return None |
| 283 | |
| 284 | |
| 285 | def cursor_on_closing_char_pair( |