fix for top-of-file pruning in default edit step

This commit is contained in:
Nate Sesti 2023-07-21 01:49:28 -07:00
parent 57a8b62fb9
commit 08e73ec81e
3 changed files with 10 additions and 10 deletions

View file

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

View file

@ -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",

View file

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