From 1fbb545aeb76fe89d3873eb2c14237405f0ab4e6 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Thu, 20 Nov 2025 21:47:09 +0530 Subject: [PATCH 1/3] fix: revert add full file when selection is empty --- extensions/vscode/src/util/addCode.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extensions/vscode/src/util/addCode.ts b/extensions/vscode/src/util/addCode.ts index 05d9c3afe..61147c183 100644 --- a/extensions/vscode/src/util/addCode.ts +++ b/extensions/vscode/src/util/addCode.ts @@ -94,7 +94,10 @@ export function getRangeInFileWithContents( export async function addHighlightedCodeToContext( webviewProtocol: VsCodeWebviewProtocol | undefined, ) { - const rangeInFileWithContents = getRangeInFileWithContents(true); + // the passed argument below was set to true in https://github.com/continuedev/continue/pull/6711 + // which would add the entire file contents when selection is empty + // currently this behaviour is reverted and needs further investigation + const rangeInFileWithContents = getRangeInFileWithContents(false); if (rangeInFileWithContents) { webviewProtocol?.request("highlightedCode", { rangeInFileWithContents, From d60713311111517c013535fa762071f1b27355c5 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Fri, 21 Nov 2025 18:12:08 +0530 Subject: [PATCH 2/3] change wording --- extensions/vscode/src/util/addCode.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/vscode/src/util/addCode.ts b/extensions/vscode/src/util/addCode.ts index 61147c183..518f6e1f2 100644 --- a/extensions/vscode/src/util/addCode.ts +++ b/extensions/vscode/src/util/addCode.ts @@ -96,7 +96,7 @@ export async function addHighlightedCodeToContext( ) { // the passed argument below was set to true in https://github.com/continuedev/continue/pull/6711 // which would add the entire file contents when selection is empty - // currently this behaviour is reverted and needs further investigation + // some of this behaviour is reverted and needs further investigation const rangeInFileWithContents = getRangeInFileWithContents(false); if (rangeInFileWithContents) { webviewProtocol?.request("highlightedCode", { From 77de1a518b347cae1783a6be82811447f40b73bc Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Fri, 21 Nov 2025 18:20:16 +0530 Subject: [PATCH 3/3] skip the added tests --- .../e2e/tests/KeyboardShortcuts.test.ts | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/extensions/vscode/e2e/tests/KeyboardShortcuts.test.ts b/extensions/vscode/e2e/tests/KeyboardShortcuts.test.ts index c557708ef..143c9b120 100644 --- a/extensions/vscode/e2e/tests/KeyboardShortcuts.test.ts +++ b/extensions/vscode/e2e/tests/KeyboardShortcuts.test.ts @@ -219,7 +219,8 @@ describe("Keyboard Shortcuts", () => { await GUIActions.executeFocusContinueInputShortcut(driver); }).timeout(DEFAULT_TIMEOUT.XL); - it("Should create a code block with the whole file when Cmd+L is pressed on an empty line", async () => { + // the below 2 skips are skipped because some behaviour from https://github.com/continuedev/continue/pull/6711 was reverted + it.skip("Should create a code block with the whole file when Cmd+L is pressed on an empty line", async () => { const text = "Hello,\n\n\nworld!"; await editor.setText(text); @@ -239,23 +240,26 @@ describe("Keyboard Shortcuts", () => { expect(codeblockContent).to.equal(text); }); - it("Should create a code block when Cmd+L is pressed on a non-empty line", async () => { - const text = "Hello, world!"; + it.skip( + "Should create a code block when Cmd+L is pressed on a non-empty line", + async () => { + const text = "Hello, world!"; - await editor.setText(text); - await editor.moveCursor(1, 7); //Move cursor to the 1st space + await editor.setText(text); + await editor.moveCursor(1, 7); //Move cursor to the 1st space - await GUIActions.executeFocusContinueInputShortcut(driver); + await GUIActions.executeFocusContinueInputShortcut(driver); - ({ view } = await GUIActions.switchToReactIframe()); + ({ view } = await GUIActions.switchToReactIframe()); - const codeBlock = await TestUtils.waitForSuccess(() => - GUISelectors.getInputBoxCodeBlockAtIndex(view, 0), - ); - const codeblockContent = await codeBlock.getAttribute( - "data-codeblockcontent", - ); + const codeBlock = await TestUtils.waitForSuccess(() => + GUISelectors.getInputBoxCodeBlockAtIndex(view, 0), + ); + const codeblockContent = await codeBlock.getAttribute( + "data-codeblockcontent", + ); - expect(codeblockContent).to.equal(text); - }).timeout(DEFAULT_TIMEOUT.XL); + expect(codeblockContent).to.equal(text); + }, + ).timeout(DEFAULT_TIMEOUT.XL); });