From 866b16c3a9c9d88a7b90aa8a43610fc4884ab123 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Fri, 11 Aug 2023 14:36:28 -0700 Subject: fix: :bug: fix "code" keyerror prior to context_manager.start --- continuedev/src/continuedev/core/autopilot.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'continuedev/src') diff --git a/continuedev/src/continuedev/core/autopilot.py b/continuedev/src/continuedev/core/autopilot.py index 71971ddd..9100c34e 100644 --- a/continuedev/src/continuedev/core/autopilot.py +++ b/continuedev/src/continuedev/core/autopilot.py @@ -184,6 +184,9 @@ class Autopilot(ContinueBaseModel): await self._run_singular_step(step) async def handle_highlighted_code(self, range_in_files: List[RangeInFileWithContents]): + if "code" not in self.context_manager.context_providers: + return + # Add to context manager await self.context_manager.context_providers["code"].handle_highlighted_code( range_in_files) @@ -208,10 +211,16 @@ class Autopilot(ContinueBaseModel): await self.update_subscribers() async def toggle_adding_highlighted_code(self): + if "code" not in self.context_manager.context_providers: + return + self.context_manager.context_providers["code"].adding_highlighted_code = not self.context_manager.context_providers["code"].adding_highlighted_code await self.update_subscribers() async def set_editing_at_ids(self, ids: List[str]): + if "code" not in self.context_manager.context_providers: + return + await self.context_manager.context_providers["code"].set_editing_at_ids(ids) await self.update_subscribers() -- cgit v1.2.3-70-g09d2