The name of a method being defined
(
cursor_offset: int, line: str
)
| 238 | |
| 239 | |
| 240 | def current_method_definition_name( |
| 241 | cursor_offset: int, line: str |
| 242 | ) -> LinePart | None: |
| 243 | """The name of a method being defined""" |
| 244 | for m in _current_method_definition_name_re.finditer(line): |
| 245 | if m.start(1) <= cursor_offset <= m.end(1): |
| 246 | return LinePart(m.start(1), m.end(1), m.group(1)) |
| 247 | return None |
| 248 | |
| 249 | |
| 250 | _current_single_word_re = LazyReCompile(r"(?<![.])\b([a-zA-Z_][\w]*)") |