Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions extensions/vscode/e2e/tests/KeyboardShortcuts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
});
5 changes: 4 additions & 1 deletion extensions/vscode/src/util/addCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
// some of this behaviour is reverted and needs further investigation
const rangeInFileWithContents = getRangeInFileWithContents(false);
if (rangeInFileWithContents) {
webviewProtocol?.request("highlightedCode", {
rangeInFileWithContents,
Expand Down
Loading