MCPcopy Index your code
hub / github.com/bpython/bpython / current_method_definition_name

Function current_method_definition_name

bpython/line.py:240–247  ·  view source on GitHub ↗

The name of a method being defined

(
    cursor_offset: int, line: str
)

Source from the content-addressed store, hash-verified

238
239
240def 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]*)")

Callers

nothing calls this directly

Calls 3

LinePartClass · 0.85
finditerMethod · 0.80
startMethod · 0.80

Tested by

no test coverage detected