Skip to content

Commit 0b7ff1f

Browse files
authored
Merge pull request #8820 from uinstinct/revert-add-full-file
revert: add full file when selection is empty
2 parents 9a08e2b + 1bf2385 commit 0b7ff1f

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

extensions/vscode/e2e/tests/KeyboardShortcuts.test.ts

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ describe("Keyboard Shortcuts", () => {
219219
await GUIActions.executeFocusContinueInputShortcut(driver);
220220
}).timeout(DEFAULT_TIMEOUT.XL);
221221

222-
it("Should create a code block with the whole file when Cmd+L is pressed on an empty line", async () => {
222+
// the below 2 skips are skipped because some behaviour from https://github.com/continuedev/continue/pull/6711 was reverted
223+
it.skip("Should create a code block with the whole file when Cmd+L is pressed on an empty line", async () => {
223224
const text = "Hello,\n\n\nworld!";
224225

225226
await editor.setText(text);
@@ -239,23 +240,26 @@ describe("Keyboard Shortcuts", () => {
239240
expect(codeblockContent).to.equal(text);
240241
});
241242

242-
it("Should create a code block when Cmd+L is pressed on a non-empty line", async () => {
243-
const text = "Hello, world!";
243+
it.skip(
244+
"Should create a code block when Cmd+L is pressed on a non-empty line",
245+
async () => {
246+
const text = "Hello, world!";
244247

245-
await editor.setText(text);
246-
await editor.moveCursor(1, 7); //Move cursor to the 1st space
248+
await editor.setText(text);
249+
await editor.moveCursor(1, 7); //Move cursor to the 1st space
247250

248-
await GUIActions.executeFocusContinueInputShortcut(driver);
251+
await GUIActions.executeFocusContinueInputShortcut(driver);
249252

250-
({ view } = await GUIActions.switchToReactIframe());
253+
({ view } = await GUIActions.switchToReactIframe());
251254

252-
const codeBlock = await TestUtils.waitForSuccess(() =>
253-
GUISelectors.getInputBoxCodeBlockAtIndex(view, 0),
254-
);
255-
const codeblockContent = await codeBlock.getAttribute(
256-
"data-codeblockcontent",
257-
);
255+
const codeBlock = await TestUtils.waitForSuccess(() =>
256+
GUISelectors.getInputBoxCodeBlockAtIndex(view, 0),
257+
);
258+
const codeblockContent = await codeBlock.getAttribute(
259+
"data-codeblockcontent",
260+
);
258261

259-
expect(codeblockContent).to.equal(text);
260-
}).timeout(DEFAULT_TIMEOUT.XL);
262+
expect(codeblockContent).to.equal(text);
263+
},
264+
).timeout(DEFAULT_TIMEOUT.XL);
261265
});

extensions/vscode/src/util/addCode.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ export function getRangeInFileWithContents(
9494
export async function addHighlightedCodeToContext(
9595
webviewProtocol: VsCodeWebviewProtocol | undefined,
9696
) {
97-
const rangeInFileWithContents = getRangeInFileWithContents(true);
97+
// the passed argument below was set to true in https://github.com/continuedev/continue/pull/6711
98+
// which would add the entire file contents when selection is empty
99+
// some of this behaviour is reverted and needs further investigation
100+
const rangeInFileWithContents = getRangeInFileWithContents(false);
98101
if (rangeInFileWithContents) {
99102
webviewProtocol?.request("highlightedCode", {
100103
rangeInFileWithContents,

0 commit comments

Comments
 (0)