fix: 🐛 access highlighted_code through context_manager

This commit is contained in:
Nate Sesti 2023-07-26 02:22:47 -07:00
parent 17d379cc2d
commit 1afb37b5bb
5 changed files with 10 additions and 8 deletions

View file

@ -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)

View file

@ -1,12 +1,12 @@
{
"name": "continue",
"version": "0.0.202",
"version": "0.0.203",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "continue",
"version": "0.0.202",
"version": "0.0.203",
"license": "Apache-2.0",
"dependencies": {
"@electron/rebuild": "^3.2.10",

View file

@ -14,7 +14,7 @@
"displayName": "Continue",
"pricing": "Free",
"description": "The open-source coding autopilot",
"version": "0.0.202",
"version": "0.0.203",
"publisher": "Continue",
"engines": {
"vscode": "^1.67.0"

View file

@ -262,7 +262,7 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {
key={`${item.description.id.item_id}${idx}`}
item={item}
warning={
item.content.length > 4000 && item.editing
false && item.content.length > 4000 && item.editing
? "Editing such a large range may be slow"
: undefined
}

View file

@ -38,7 +38,7 @@ const Onboarding = () => {
useEffect(() => {
const hasVisited = localStorage.getItem("hasVisited");
if (hasVisited) {
setCounter(0);
setCounter(4);
} else {
setCounter(0);
localStorage.setItem("hasVisited", "true");