From 1afb37b5bb901d95c493039591b9243cd2cdd6f7 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 26 Jul 2023 02:22:47 -0700 Subject: fix: :bug: access highlighted_code through context_manager --- continuedev/src/continuedev/core/sdk.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'continuedev/src') diff --git a/continuedev/src/continuedev/core/sdk.py b/continuedev/src/continuedev/core/sdk.py index e9aefa76..992bc1cf 100644 --- a/continuedev/src/continuedev/core/sdk.py +++ b/continuedev/src/continuedev/core/sdk.py @@ -277,9 +277,11 @@ class ContinueSDK(AbstractContinueSDK): return ContinueConfig() if self._last_valid_config is None else self._last_valid_config def get_code_context(self, only_editing: bool = False) -> List[RangeInFileWithContents]: - context = list(filter(lambda x: x.editing, self.__autopilot._highlighted_ranges) - ) if only_editing else self.__autopilot._highlighted_ranges - return [c.range for c in context] + highlighted_ranges = self.__autopilot.context_manager.context_providers[ + "code"].highlighted_ranges + context = list(filter(lambda x: x.item.editing, highlighted_ranges) + ) if only_editing else highlighted_ranges + return [c.rif for c in context] def set_loading_message(self, message: str): # self.__autopilot.set_loading_message(message) -- cgit v1.2.3-70-g09d2