summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-07-05 20:35:59 -0700
committerNate Sesti <sestinj@gmail.com>2023-07-05 20:35:59 -0700
commit22b02641b4b14ffad32914d046e645cf6f850253 (patch)
tree7a4f00fbbc4132a4c08a3d0646549c53e50eb0ee
parent8a5cda89378640cef375689d6be48f9ab21cab7e (diff)
downloadsncontinue-22b02641b4b14ffad32914d046e645cf6f850253.tar.gz
sncontinue-22b02641b4b14ffad32914d046e645cf6f850253.tar.bz2
sncontinue-22b02641b4b14ffad32914d046e645cf6f850253.zip
stuff
-rw-r--r--continuedev/src/continuedev/core/autopilot.py4
-rw-r--r--continuedev/src/continuedev/steps/core/core.py19
-rw-r--r--extension/package-lock.json4
-rw-r--r--extension/package.json6
-rw-r--r--extension/react-app/src/components/ComboBox.tsx2
-rw-r--r--extension/src/diffs.ts22
6 files changed, 39 insertions, 18 deletions
diff --git a/continuedev/src/continuedev/core/autopilot.py b/continuedev/src/continuedev/core/autopilot.py
index 29be3b79..b1c4f471 100644
--- a/continuedev/src/continuedev/core/autopilot.py
+++ b/continuedev/src/continuedev/core/autopilot.py
@@ -147,6 +147,10 @@ class Autopilot(ContinueBaseModel):
if not self._adding_highlighted_code:
return
+ # Filter out rifs from ~/.continue/diffs folder
+ range_in_files = [
+ rif for rif in range_in_files if not os.path.dirname(rif.filepath) == os.path.expanduser("~/.continue/diffs")]
+
workspace_path = self.continue_sdk.ide.workspace_directory
for rif in range_in_files:
rif.filepath = os.path.basename(rif.filepath)
diff --git a/continuedev/src/continuedev/steps/core/core.py b/continuedev/src/continuedev/steps/core/core.py
index c74412ba..3a7c8876 100644
--- a/continuedev/src/continuedev/steps/core/core.py
+++ b/continuedev/src/continuedev/steps/core/core.py
@@ -332,8 +332,9 @@ class DefaultModelEditCodeStep(Step):
# Highlight the line to show progress
line_to_highlight = current_line_in_file - len(current_block_lines)
- await sdk.ide.highlightCode(RangeInFile(filepath=rif.filepath, range=Range.from_shorthand(
- line_to_highlight, 0, line_to_highlight, 0)), "#FFFFFF22" if len(current_block_lines) == 0 else "#00FF0022")
+ if False:
+ await sdk.ide.highlightCode(RangeInFile(filepath=rif.filepath, range=Range.from_shorthand(
+ line_to_highlight, 0, line_to_highlight, 0)), "#FFFFFF22" if len(current_block_lines) == 0 else "#00FF0022")
if len(current_block_lines) == 0:
# Set this as the start of the next block
@@ -382,12 +383,14 @@ class DefaultModelEditCodeStep(Step):
replacement = "\n".join(current_block_lines)
start_line = current_block_start
end_line = current_block_start + index_of_last_line_in_block
- await sdk.ide.showSuggestion(FileEdit(
- filepath=rif.filepath,
- range=Range.from_shorthand(
- start_line, 0, end_line, 0),
- replacement=replacement
- ))
+
+ if False:
+ await sdk.ide.showSuggestion(FileEdit(
+ filepath=rif.filepath,
+ range=Range.from_shorthand(
+ start_line, 0, end_line, 0),
+ replacement=replacement
+ ))
# Reset current block / update variables
current_line_in_file += 1
diff --git a/extension/package-lock.json b/extension/package-lock.json
index 6e527583..b322acb7 100644
--- a/extension/package-lock.json
+++ b/extension/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "continue",
- "version": "0.0.112",
+ "version": "0.0.113",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "continue",
- "version": "0.0.112",
+ "version": "0.0.113",
"license": "Apache-2.0",
"dependencies": {
"@electron/rebuild": "^3.2.10",
diff --git a/extension/package.json b/extension/package.json
index 413e5b89..09703da4 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.112",
+ "version": "0.0.113",
"publisher": "Continue",
"engines": {
"vscode": "^1.67.0"
@@ -130,12 +130,12 @@
"key": "shift+ctrl+enter"
},
{
- "command": "continue.acceptAllSuggestions",
+ "command": "continue.acceptDiff",
"mac": "shift+cmd+enter",
"key": "shift+ctrl+enter"
},
{
- "command": "continue.rejectAllSuggestions",
+ "command": "continue.rejectDiff",
"mac": "shift+cmd+backspace",
"key": "shift+ctrl+backspace"
}
diff --git a/extension/react-app/src/components/ComboBox.tsx b/extension/react-app/src/components/ComboBox.tsx
index 61c9ab1e..81b148b9 100644
--- a/extension/react-app/src/components/ComboBox.tsx
+++ b/extension/react-app/src/components/ComboBox.tsx
@@ -55,7 +55,7 @@ const MainTextInput = styled.textarea`
}
`;
-const UlMaxHeight = 200;
+const UlMaxHeight = 400;
const Ul = styled.ul<{
hidden: boolean;
showAbove: boolean;
diff --git a/extension/src/diffs.ts b/extension/src/diffs.ts
index 178b1a9d..1b8888e8 100644
--- a/extension/src/diffs.ts
+++ b/extension/src/diffs.ts
@@ -92,7 +92,14 @@ class DiffManager {
fs.unlinkSync(diffInfo.newFilepath);
}
- acceptDiff(newFilepath: string) {
+ acceptDiff(newFilepath?: string) {
+ // If no newFilepath is provided and there is only one in the dictionary, use that
+ if (!newFilepath && this.diffs.size === 1) {
+ newFilepath = Array.from(this.diffs.keys())[0];
+ }
+ if (!newFilepath) {
+ return;
+ }
// Get the diff info, copy new file to original, then delete from record and close the corresponding editor
const diffInfo = this.diffs.get(newFilepath);
if (!diffInfo) {
@@ -105,7 +112,14 @@ class DiffManager {
this.cleanUpDiff(diffInfo);
}
- rejectDiff(newFilepath: string) {
+ rejectDiff(newFilepath?: string) {
+ // If no newFilepath is provided and there is only one in the dictionary, use that
+ if (!newFilepath && this.diffs.size === 1) {
+ newFilepath = Array.from(this.diffs.keys())[0];
+ }
+ if (!newFilepath) {
+ return;
+ }
const diffInfo = this.diffs.get(newFilepath);
if (!diffInfo) {
return;
@@ -117,10 +131,10 @@ class DiffManager {
export const diffManager = new DiffManager();
-export async function acceptDiffCommand(newFilepath: string) {
+export async function acceptDiffCommand(newFilepath?: string) {
diffManager.acceptDiff(newFilepath);
}
-export async function rejectDiffCommand(newFilepath: string) {
+export async function rejectDiffCommand(newFilepath?: string) {
diffManager.rejectDiff(newFilepath);
}