MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / update

Method update

src/services/ide/selection.py:48–58  ·  view source on GitHub ↗

Record a new selection from the IDE.

(self, selection: IDESelection)

Source from the content-addressed store, hash-verified

46 return [e.selection for e in reversed(self._history)]
47
48 def update(self, selection: IDESelection) -> None:
49 """Record a new selection from the IDE."""
50 entry = SelectionEntry(selection=selection, timestamp=time.time())
51 self._history.append(entry)
52 if len(self._history) > self._max_history:
53 self._history = self._history[-self._max_history:]
54 for listener in self._listeners:
55 try:
56 listener(selection)
57 except Exception:
58 logger.exception("Error in selection listener")
59
60 def on_selection(self, listener: Callable[[IDESelection], None]) -> Callable[[], None]:
61 """Register a selection change listener. Returns unsubscribe function."""

Callers 15

test_historyMethod · 0.95
test_listenerMethod · 0.95
test_clearMethod · 0.95
_load_project_scoped_envFunction · 0.45
setup_permissionsFunction · 0.45
_okFunction · 0.45
_errFunction · 0.45
_reapFunction · 0.45
_persist_settings_keysFunction · 0.45

Calls 2

SelectionEntryClass · 0.85
appendMethod · 0.45

Tested by 4

test_historyMethod · 0.76
test_listenerMethod · 0.76
test_clearMethod · 0.76