MCPcopy Create free account
hub / github.com/bpython/bpython / locate

Method locate

bpython/autocomplete.py:254–260  ·  view source on GitHub ↗

Returns a Linepart namedtuple instance or None given cursor and line A Linepart namedtuple contains a start, stop, and word. None is returned if no target for this type of completion is found under the cursor.

(self, cursor_offset: int, line: str)

Source from the content-addressed store, hash-verified

252
253 @abc.abstractmethod
254 def locate(self, cursor_offset: int, line: str) -> LinePart | None:
255 """Returns a Linepart namedtuple instance or None given cursor and line
256
257 A Linepart namedtuple contains a start, stop, and word. None is
258 returned if no target for this type of completion is found under
259 the cursor."""
260 raise NotImplementedError
261
262 def format(self, word: str) -> str:
263 return word

Callers 1

substituteMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected