diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-06-30 00:09:52 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-06-30 00:09:52 -0700 |
commit | 9427f07d6c60749205922d0f4cab5de73dec438b (patch) | |
tree | 99e246769416f0de2380ea2c5d34a09c4995c0cc | |
parent | d47c4cafb856ffe2efd7d08ceddc8ceda475a8c6 (diff) | |
download | sncontinue-9427f07d6c60749205922d0f4cab5de73dec438b.tar.gz sncontinue-9427f07d6c60749205922d0f4cab5de73dec438b.tar.bz2 sncontinue-9427f07d6c60749205922d0f4cab5de73dec438b.zip |
require python >=3.7, off-by-one err in streaming
-rw-r--r-- | continuedev/src/continuedev/steps/core/core.py | 6 | ||||
-rw-r--r-- | extension/package-lock.json | 4 | ||||
-rw-r--r-- | extension/package.json | 2 | ||||
-rw-r--r-- | extension/src/activation/environmentSetup.ts | 12 | ||||
-rw-r--r-- | extension/src/lang-server/codeLens.ts | 4 |
5 files changed, 18 insertions, 10 deletions
diff --git a/continuedev/src/continuedev/steps/core/core.py b/continuedev/src/continuedev/steps/core/core.py index 46c6a615..dfc7d309 100644 --- a/continuedev/src/continuedev/steps/core/core.py +++ b/continuedev/src/continuedev/steps/core/core.py @@ -331,7 +331,7 @@ class DefaultModelEditCodeStep(Step): # So here we will strip all matching lines from the end of current_block_lines lines_stripped = [] index_of_last_line_in_block = first_valid_match[0] - while len(current_block_lines) > 0 and current_block_lines[-1] == original_lines_below_previous_blocks[index_of_last_line_in_block]: + while len(current_block_lines) > 0 and current_block_lines[-1] == original_lines_below_previous_blocks[index_of_last_line_in_block - 1]: lines_stripped.append(current_block_lines.pop()) index_of_last_line_in_block -= 1 @@ -340,7 +340,7 @@ class DefaultModelEditCodeStep(Step): await sdk.ide.showSuggestion(FileEdit( filepath=rif.filepath, range=Range.from_shorthand( - current_block_start, 0, current_block_start + index_of_last_line_in_block, 0), + current_block_start + 1, 0, current_block_start + index_of_last_line_in_block, 0), replacement=replacement )) if replacement == "": @@ -462,7 +462,7 @@ class DefaultModelEditCodeStep(Step): await sdk.ide.showSuggestion(FileEdit( filepath=rif.filepath, range=Range.from_shorthand( - current_block_start, 0, current_block_start + len(original_lines_below_previous_blocks), 0), + current_block_start + 1, 0, current_block_start + len(original_lines_below_previous_blocks), 0), replacement="\n".join(current_block_lines) )) diff --git a/extension/package-lock.json b/extension/package-lock.json index 102d8917..26e1a631 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.0.89", + "version": "0.0.91", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "continue", - "version": "0.0.89", + "version": "0.0.91", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/extension/package.json b/extension/package.json index 9d0ef3ac..6da4196c 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.89", + "version": "0.0.91", "publisher": "Continue", "engines": { "vscode": "^1.74.0" diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts index b8c23733..2d9afaec 100644 --- a/extension/src/activation/environmentSetup.ts +++ b/extension/src/activation/environmentSetup.ts @@ -66,10 +66,18 @@ async function getPythonPipCommands() { vscode.window.showErrorMessage( "Continue requires Python3. Please install from https://www.python.org/downloads, reload VS Code, and try again." ); - throw new Error("Python3 is not installed."); + throw new Error("Python 3.7 or greater is not installed."); } } - let pipCmd = pythonCmd.endsWith("3") ? "pip3" : "pip"; + + const version = stdout.split(" ")[1]; + if (version < "3.7") { + vscode.window.showErrorMessage( + "Continue requires Python3 version 3.7 or greater. Please update your Python3 installation, reload VS Code, and try again." + ); + throw new Error("Python3 is not installed."); + } + const pipCmd = pythonCmd.endsWith("3") ? "pip3" : "pip"; return [pythonCmd, pipCmd]; } diff --git a/extension/src/lang-server/codeLens.ts b/extension/src/lang-server/codeLens.ts index 03a9a0a7..21448e31 100644 --- a/extension/src/lang-server/codeLens.ts +++ b/extension/src/lang-server/codeLens.ts @@ -21,12 +21,12 @@ class SuggestionsCodeLensProvider implements vscode.CodeLensProvider { codeLenses.push( new vscode.CodeLens(range, { title: "Accept ✅", - command: locked ? "" : "continue.acceptSuggestion", + command: "continue.acceptSuggestion", arguments: [suggestion], }), new vscode.CodeLens(range, { title: "Reject ❌", - command: locked ? "" : "continue.rejectSuggestion", + command: "continue.rejectSuggestion", arguments: [suggestion], }) ); |