summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-07-21 01:49:28 -0700
committerNate Sesti <sestinj@gmail.com>2023-07-21 01:49:28 -0700
commit0cd32ba813f5506c0871159658728b8ce31825e1 (patch)
treedd1fe0b3320801f2e92bdaaf5ebfaf39c0585562
parent883219874035f46ca3409901ea186493a2ce46a5 (diff)
downloadsncontinue-0cd32ba813f5506c0871159658728b8ce31825e1.tar.gz
sncontinue-0cd32ba813f5506c0871159658728b8ce31825e1.tar.bz2
sncontinue-0cd32ba813f5506c0871159658728b8ce31825e1.zip
fix for top-of-file pruning in default edit step
-rw-r--r--continuedev/src/continuedev/steps/core/core.py14
-rw-r--r--extension/package-lock.json4
-rw-r--r--extension/package.json2
3 files changed, 10 insertions, 10 deletions
diff --git a/continuedev/src/continuedev/steps/core/core.py b/continuedev/src/continuedev/steps/core/core.py
index 4afc36e8..98600f8b 100644
--- a/continuedev/src/continuedev/steps/core/core.py
+++ b/continuedev/src/continuedev/steps/core/core.py
@@ -220,13 +220,13 @@ class DefaultModelEditCodeStep(Step):
if total_tokens < MAX_TOKENS_FOR_MODEL[model_to_use.name]:
break
- if total_tokens > MAX_TOKENS_FOR_MODEL[model_to_use.name]:
- while cur_start_line < max_start_line:
- cur_start_line += 1
- total_tokens -= model_to_use.count_tokens(
- full_file_contents_lst[cur_end_line])
- if total_tokens < MAX_TOKENS_FOR_MODEL[model_to_use.name]:
- break
+ if total_tokens > MAX_TOKENS_FOR_MODEL[model_to_use.name]:
+ while cur_start_line < max_start_line:
+ cur_start_line += 1
+ total_tokens -= model_to_use.count_tokens(
+ full_file_contents_lst[cur_start_line])
+ if total_tokens < MAX_TOKENS_FOR_MODEL[model_to_use.name]:
+ break
# Now use the found start/end lines to get the prefix and suffix strings
file_prefix = "\n".join(
diff --git a/extension/package-lock.json b/extension/package-lock.json
index 7ca62d4a..d44b84c4 100644
--- a/extension/package-lock.json
+++ b/extension/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "continue",
- "version": "0.0.186",
+ "version": "0.0.187",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "continue",
- "version": "0.0.186",
+ "version": "0.0.187",
"license": "Apache-2.0",
"dependencies": {
"@electron/rebuild": "^3.2.10",
diff --git a/extension/package.json b/extension/package.json
index 76b80ed7..34bc8bc4 100644
--- a/extension/package.json
+++ b/extension/package.json
@@ -14,7 +14,7 @@
"displayName": "Continue",
"pricing": "Free",
"description": "The open-source coding autopilot",
- "version": "0.0.186",
+ "version": "0.0.187",
"publisher": "Continue",
"engines": {
"vscode": "^1.67.0"