From 603fa39a1a23318b80e21e48e192d61c12e6f1a4 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 12 Dec 2024 11:33:37 -0800 Subject: [PATCH 01/15] postprocessing rule for no suffix --- core/autocomplete/postprocessing/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/autocomplete/postprocessing/index.ts b/core/autocomplete/postprocessing/index.ts index ed7c41f05..c2cf5049b 100644 --- a/core/autocomplete/postprocessing/index.ts +++ b/core/autocomplete/postprocessing/index.ts @@ -90,6 +90,17 @@ export function postprocessCompletion({ completion = completion.slice(1); } } + + // When there is no suffix, Codestral tends to begin with a new line + // We do this to avoid double new lines + if ( + suffix.length === 0 && + prefix.endsWith("\n\n") && + completion.startsWith("\n") + ) { + // Remove a single leading \n from the completion + completion = completion.slice(1); + } } if (llm.model.includes("granite")) { From dd36a6606dcd3c166a3f8566629a064293ddfebd Mon Sep 17 00:00:00 2001 From: henry Date: Thu, 12 Dec 2024 16:51:57 -0600 Subject: [PATCH 02/15] full screen now opens in current session --- core/protocol/passThrough.ts | 1 + core/protocol/webview.ts | 1 + extensions/vscode/src/commands.ts | 11 ++++++++++- gui/src/hooks/useSetup.ts | 8 ++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/core/protocol/passThrough.ts b/core/protocol/passThrough.ts index d5299614f..95ceb9885 100644 --- a/core/protocol/passThrough.ts +++ b/core/protocol/passThrough.ts @@ -73,6 +73,7 @@ export const CORE_TO_WEBVIEW_PASS_THROUGH: (keyof ToWebviewFromCoreProtocol)[] = "didChangeAvailableProfiles", "setTTSActive", "getWebviewHistoryLength", + "getCurrentSessionId", "signInToControlPlane", "openDialogMessage", "docs/suggestions", diff --git a/core/protocol/webview.ts b/core/protocol/webview.ts index fb6a8837c..27fd2fc38 100644 --- a/core/protocol/webview.ts +++ b/core/protocol/webview.ts @@ -24,6 +24,7 @@ export type ToWebviewFromIdeOrCoreProtocol = { ]; setTTSActive: [boolean, void]; getWebviewHistoryLength: [undefined, number]; + getCurrentSessionId: [undefined, string]; signInToControlPlane: [undefined, void]; openDialogMessage: ["account", void]; "docs/suggestions": [PackageDocsResult[], void]; diff --git a/extensions/vscode/src/commands.ts b/extensions/vscode/src/commands.ts index 5f843153c..943072271 100644 --- a/extensions/vscode/src/commands.ts +++ b/extensions/vscode/src/commands.ts @@ -754,9 +754,10 @@ const getCommandsMap: ( "continue.applyCodeFromChat": () => { void sidebar.webviewProtocol.request("applyCodeFromChat", undefined); }, - "continue.toggleFullScreen": () => { + "continue.toggleFullScreen": async () => { focusGUI(); + const sessionId = await sidebar.webviewProtocol.request("getCurrentSessionId", undefined); // Check if full screen is already open by checking open tabs const fullScreenTab = getFullScreenTab(); @@ -777,6 +778,7 @@ const getCommandsMap: ( vscode.ViewColumn.One, { retainContextWhenHidden: true, + enableScripts: true, }, ); fullScreenPanel = panel; @@ -789,6 +791,13 @@ const getCommandsMap: ( undefined, true, ); + + panel.onDidChangeViewState(() => { + vscode.commands.executeCommand("continue.newSession"); + if(sessionId){ + vscode.commands.executeCommand("continue.focusContinueSessionId", sessionId); + } + }); // When panel closes, reset the webview and focus panel.onDidDispose( diff --git a/gui/src/hooks/useSetup.ts b/gui/src/hooks/useSetup.ts index 0e97965bb..2db1252ab 100644 --- a/gui/src/hooks/useSetup.ts +++ b/gui/src/hooks/useSetup.ts @@ -137,6 +137,14 @@ function useSetup() { [history], ); + useWebviewListener( + "getCurrentSessionId", + async () => { + return sessionId + }, + [sessionId], + ); + useWebviewListener("setInactive", async () => { dispatch(setInactive()); }); From 9c960091b6d817c64b81cb61d352c6ac19ed569a Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 12 Dec 2024 17:17:15 -0800 Subject: [PATCH 03/15] WIP better VS Code completion display --- core/util/findLast.ts | 14 +++ extensions/vscode/package-lock.json | 28 ++++- extensions/vscode/package.json | 1 + .../src/autocomplete/completionProvider.ts | 103 +++++++++++++++++- 4 files changed, 135 insertions(+), 11 deletions(-) create mode 100644 core/util/findLast.ts diff --git a/core/util/findLast.ts b/core/util/findLast.ts new file mode 100644 index 000000000..fb39829e7 --- /dev/null +++ b/core/util/findLast.ts @@ -0,0 +1,14 @@ +export function findLastIndex( + arr: any[], + criterion: (item: any) => boolean, +): number { + let lastIndex = -1; + + for (let i = arr.length - 1; i >= 0; i--) { + if (criterion(arr[i])) { + lastIndex = i; + break; + } + } + return lastIndex; +} diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 04349b1f1..3e213c999 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.9.243", + "version": "0.9.244", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "0.9.243", + "version": "0.9.244", "license": "Apache-2.0", "dependencies": { "@continuedev/fetch": "^1.0.3", @@ -20,6 +20,7 @@ "core": "file:../../core", "cors": "^2.8.5", "dbinfoz": "^0.14.0", + "diff": "^7.0.0", "downshift": "^7.6.0", "esbuild": "^0.17.19", "express": "^4.18.2", @@ -4981,9 +4982,9 @@ "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==" }, "node_modules/diff": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", - "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", "engines": { "node": ">=0.3.1" } @@ -8858,6 +8859,15 @@ "wrap-ansi": "^7.0.0" } }, + "node_modules/mocha/node_modules/diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/mocha/node_modules/minimatch": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", @@ -13165,6 +13175,14 @@ "node": ">=8" } }, + "node_modules/uvu/node_modules/diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/v8-to-istanbul": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 24b8ebf1f..917f7d597 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -678,6 +678,7 @@ "core": "file:../../core", "cors": "^2.8.5", "dbinfoz": "^0.14.0", + "diff": "^7.0.0", "downshift": "^7.6.0", "esbuild": "^0.17.19", "express": "^4.18.2", diff --git a/extensions/vscode/src/autocomplete/completionProvider.ts b/extensions/vscode/src/autocomplete/completionProvider.ts index f9d397388..1db056060 100644 --- a/extensions/vscode/src/autocomplete/completionProvider.ts +++ b/extensions/vscode/src/autocomplete/completionProvider.ts @@ -6,6 +6,7 @@ import { import { ConfigHandler } from "core/config/ConfigHandler"; import { v4 as uuidv4 } from "uuid"; import * as vscode from "vscode"; +const Diff = require("diff"); import { showFreeTrialLoginMessage } from "../util/messages"; import { VsCodeWebviewProtocol } from "../webviewProtocol"; @@ -20,8 +21,16 @@ import { } from "./statusBar"; import type { IDE } from "core"; +import { findLastIndex } from "core/util/findLast"; import type { TabAutocompleteModel } from "../util/loadAutocompleteModel"; +interface DiffType { + count: number; + added: boolean; + removed: boolean; + value: string; +} + interface VsCodeCompletionInput { document: vscode.TextDocument; position: vscode.Position; @@ -249,13 +258,72 @@ export class ContinueCompletionProvider // Construct the range/text to show const startPos = selectedCompletionInfo?.range.start ?? position; - const completionRange = new vscode.Range( - startPos, - startPos.translate(0, outcome.completion.length), - ); + let range = new vscode.Range(startPos, startPos); + let completionText = outcome.completion; + const isSingleLineCompletion = outcome.completion.split("\n").length <= 1; + + if (isSingleLineCompletion) { + const lastLineOfCompletionText = completionText.split("\n").pop(); + const currentText = document + .lineAt(startPos) + .text.substring(startPos.character); + const diffs: DiffType[] = Diff.diffWords( + currentText, + lastLineOfCompletionText, + ); + console.log(currentText + "\n" + lastLineOfCompletionText); + console.log(diffs); + + if (diffPatternMatches(diffs, ["+"])) { + // Just insert, we're already at the end of the line + } else if ( + diffPatternMatches(diffs, ["+", "="]) || + diffPatternMatches(diffs, ["+", "=", "+"]) + ) { + // The model repeated the text after the cursor to the end of the line + range = new vscode.Range( + startPos, + document.lineAt(startPos).range.end, + ); + } else if (diffPatternMatches(diffs, ["+", "-"])) { + // We are midline and the model just inserted without repeating to the end of the line + // We want to move the cursor to the end of the line + range = new vscode.Range( + startPos, + document.lineAt(startPos).range.end, + ); + // Find the last removed part of the diff + const lastRemovedIndex = findLastIndex( + diffs, + (diff) => diff.removed === true, + ); + + const lastRemovedContent = diffs[lastRemovedIndex].value; + completionText += lastRemovedContent; + } else { + // Diff is too complicated, just insert. + // This is the safe way to ensure that it is displayed + const truncatedInsertion = diffs.find((d) => d.added === true); + const removedWords = diffs.find((d) => d.removed === true); + + if (!truncatedInsertion || !removedWords) { + // Honestly not sure how we got here, but let's just insert to be safe + } else { + completionText = truncatedInsertion.value; + range = new vscode.Range( + startPos, + startPos.translate(0, removedWords.count), + ); + } + } + } else { + // Extend the range to the end of the line for multiline completions + range = new vscode.Range(startPos, document.lineAt(startPos).range.end); + } + const completionItem = new vscode.InlineCompletionItem( - outcome.completion, - completionRange, + completionText, + range, { title: "Log Autocomplete Outcome", command: "continue.logAutocompleteOutcome", @@ -294,3 +362,26 @@ export class ContinueCompletionProvider return true; } } + +type DiffPartType = "+" | "-" | "="; + +function diffPatternMatches( + diffs: DiffType[], + pattern: DiffPartType[], +): boolean { + if (diffs.length !== pattern.length) { + return false; + } + + for (let i = 0; i < diffs.length; i++) { + const diff = diffs[i]; + const diffPartType: DiffPartType = + !diff.added && !diff.removed ? "=" : diff.added ? "+" : "-"; + + if (diffPartType !== pattern[i]) { + return false; + } + } + + return true; +} From bd5705da2f855fae83f95eb24924af8e5a209fe1 Mon Sep 17 00:00:00 2001 From: Julien Date: Fri, 13 Dec 2024 15:32:45 +0100 Subject: [PATCH 04/15] Better fallback fim / autocomplete prompt template --- core/llm/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/llm/index.ts b/core/llm/index.ts index b54c29ec3..dc55f8a78 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -476,7 +476,7 @@ export abstract class BaseLLM implements ILLM { ): AsyncGenerator { const { completionOptions, log } = this._parseCompletionOptions(options); - const madeUpFimPrompt = `${prefix}${suffix}`; + const madeUpFimPrompt = `<|fim_prefix|>${prefix}<|fim_suffix|>${suffix}<|fim_middle|>`; if (log) { if (this.writeLog) { await this.writeLog( From c0f9df9d015247e5f1b3b0c23cd85a48e7d616d3 Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 13 Dec 2024 08:15:50 -0800 Subject: [PATCH 05/15] add git diff stop pattern --- .../filtering/streamTransforms/StreamTransformPipeline.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/autocomplete/filtering/streamTransforms/StreamTransformPipeline.ts b/core/autocomplete/filtering/streamTransforms/StreamTransformPipeline.ts index 180c339e6..1850729f1 100644 --- a/core/autocomplete/filtering/streamTransforms/StreamTransformPipeline.ts +++ b/core/autocomplete/filtering/streamTransforms/StreamTransformPipeline.ts @@ -16,6 +16,8 @@ import { streamWithNewLines, } from "./lineStream"; +const STOP_AT_PATTERNS = ["diff --git"]; + export class StreamTransformPipeline { async *transform( generator: AsyncGenerator, @@ -28,7 +30,10 @@ export class StreamTransformPipeline { ): AsyncGenerator { let charGenerator = generator; - charGenerator = stopAtStopTokens(generator, stopTokens); + charGenerator = stopAtStopTokens(generator, [ + ...stopTokens, + ...STOP_AT_PATTERNS, + ]); charGenerator = stopAtStartOf(charGenerator, suffix); for (const charFilter of helper.lang.charFilters ?? []) { charGenerator = charFilter({ From 3bc23ede3625670ab81860bba9790c567dce37bb Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 13 Dec 2024 08:17:13 -0800 Subject: [PATCH 06/15] don't autocomplete in empty, untitled files --- core/autocomplete/prefiltering/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/autocomplete/prefiltering/index.ts b/core/autocomplete/prefiltering/index.ts index 40ffa5384..a9c198a51 100644 --- a/core/autocomplete/prefiltering/index.ts +++ b/core/autocomplete/prefiltering/index.ts @@ -70,6 +70,14 @@ export async function shouldPrefilter( return true; } + // Don't offer completions when we have no information (untitled file and no file contents) + if ( + helper.filepath.includes("Untitled") && + helper.fileContents.trim() === "" + ) { + return true; + } + // if ( // helper.options.transform && // (await shouldLanguageSpecificPrefilter(helper)) From 707bc867fe91a3550732bc35963be449bdfae598 Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 13 Dec 2024 08:17:32 -0800 Subject: [PATCH 07/15] use newline instead of empty suffix --- core/autocomplete/templating/index.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/autocomplete/templating/index.ts b/core/autocomplete/templating/index.ts index 8aaa98248..5715e300b 100644 --- a/core/autocomplete/templating/index.ts +++ b/core/autocomplete/templating/index.ts @@ -5,14 +5,14 @@ import { getBasename } from "../../util"; import { AutocompleteLanguageInfo } from "../constants/AutocompleteLanguageInfo"; import { HelperVars } from "../util/HelperVars"; +import { SnippetPayload } from "../snippets"; import { AutocompleteTemplate, getTemplateForModel, } from "./AutocompleteTemplate"; -import { getStopTokens } from "./getStopTokens"; -import { SnippetPayload } from "../snippets"; -import { formatSnippets } from "./formatting"; import { getSnippets } from "./filtering"; +import { formatSnippets } from "./formatting"; +import { getStopTokens } from "./getStopTokens"; function getTemplate(helper: HelperVars): AutocompleteTemplate { if (helper.options.template) { @@ -62,6 +62,9 @@ export function renderPrompt({ // If prefix is manually passed let prefix = helper.input.manuallyPassPrefix || helper.prunedPrefix; let suffix = helper.input.manuallyPassPrefix ? "" : helper.prunedSuffix; + if (suffix === "") { + suffix = "\n"; + } const reponame = getBasename(workspaceDirs[0] ?? "myproject"); From 5dbff60b2a01da5e7a53dc6858372513e2e57584 Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 13 Dec 2024 08:17:55 -0800 Subject: [PATCH 08/15] correctly pass file contents for untitled files --- .../vscode/src/autocomplete/completionProvider.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/extensions/vscode/src/autocomplete/completionProvider.ts b/extensions/vscode/src/autocomplete/completionProvider.ts index 1db056060..626b500f2 100644 --- a/extensions/vscode/src/autocomplete/completionProvider.ts +++ b/extensions/vscode/src/autocomplete/completionProvider.ts @@ -199,12 +199,20 @@ export class ContinueCompletionProvider } } } + + // Manually pass file contents for unsaved, untitled files + let filepath = document.uri.fsPath; + if (document.isUntitled) { + manuallyPassFileContents = document.getText(); + } + // Handle commit message input box let manuallyPassPrefix: string | undefined = undefined; const input: AutocompleteInput = { + isUntitledFile: document.isUntitled, completionId: uuidv4(), - filepath: document.uri.fsPath, + filepath, pos, recentlyEditedFiles: [], recentlyEditedRanges: From feccf0eb10f613f7afd4b8a0519ae74cc35d1a89 Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 13 Dec 2024 08:18:07 -0800 Subject: [PATCH 09/15] isUntitledFile --- core/autocomplete/util/types.ts | 1 + extensions/vscode/src/VsCodeIde.ts | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/core/autocomplete/util/types.ts b/core/autocomplete/util/types.ts index d54d57bd2..c11d8c2d9 100644 --- a/core/autocomplete/util/types.ts +++ b/core/autocomplete/util/types.ts @@ -13,6 +13,7 @@ export type RecentlyEditedRange = RangeInFile & { }; export interface AutocompleteInput { + isUntitledFile: boolean; completionId: string; filepath: string; pos: Position; diff --git a/extensions/vscode/src/VsCodeIde.ts b/extensions/vscode/src/VsCodeIde.ts index 5138ba490..9e237350e 100644 --- a/extensions/vscode/src/VsCodeIde.ts +++ b/extensions/vscode/src/VsCodeIde.ts @@ -480,7 +480,6 @@ class VsCodeIde implements IDE { const contents = new TextDecoder().decode(truncatedBytes); return contents; } catch (e) { - console.warn("Error reading file", e); return ""; } } From f5cc6e77ebe90a2860945247259d7f9346cdcc55 Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 13 Dec 2024 08:50:15 -0800 Subject: [PATCH 10/15] improve autocomplete diff display --- .../src/autocomplete/completionProvider.ts | 48 ++++++++----------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/extensions/vscode/src/autocomplete/completionProvider.ts b/extensions/vscode/src/autocomplete/completionProvider.ts index 626b500f2..aa3880952 100644 --- a/extensions/vscode/src/autocomplete/completionProvider.ts +++ b/extensions/vscode/src/autocomplete/completionProvider.ts @@ -21,7 +21,6 @@ import { } from "./statusBar"; import type { IDE } from "core"; -import { findLastIndex } from "core/util/findLast"; import type { TabAutocompleteModel } from "../util/loadAutocompleteModel"; interface DiffType { @@ -279,8 +278,6 @@ export class ContinueCompletionProvider currentText, lastLineOfCompletionText, ); - console.log(currentText + "\n" + lastLineOfCompletionText); - console.log(diffs); if (diffPatternMatches(diffs, ["+"])) { // Just insert, we're already at the end of the line @@ -293,35 +290,32 @@ export class ContinueCompletionProvider startPos, document.lineAt(startPos).range.end, ); - } else if (diffPatternMatches(diffs, ["+", "-"])) { + } else if ( + diffPatternMatches(diffs, ["+", "-"]) || + diffPatternMatches(diffs, ["-", "+"]) + ) { // We are midline and the model just inserted without repeating to the end of the line // We want to move the cursor to the end of the line - range = new vscode.Range( - startPos, - document.lineAt(startPos).range.end, - ); - // Find the last removed part of the diff - const lastRemovedIndex = findLastIndex( - diffs, - (diff) => diff.removed === true, - ); - - const lastRemovedContent = diffs[lastRemovedIndex].value; - completionText += lastRemovedContent; + // range = new vscode.Range( + // startPos, + // document.lineAt(startPos).range.end, + // ); + // // Find the last removed part of the diff + // const lastRemovedIndex = findLastIndex( + // diffs, + // (diff) => diff.removed === true, + // ); + // const lastRemovedContent = diffs[lastRemovedIndex].value; + // completionText += lastRemovedContent; } else { - // Diff is too complicated, just insert. + // Diff is too complicated, just insert the first added part of the diff // This is the safe way to ensure that it is displayed - const truncatedInsertion = diffs.find((d) => d.added === true); - const removedWords = diffs.find((d) => d.removed === true); - - if (!truncatedInsertion || !removedWords) { - // Honestly not sure how we got here, but let's just insert to be safe + if (diffs[0]?.added) { + completionText = diffs[0].value; } else { - completionText = truncatedInsertion.value; - range = new vscode.Range( - startPos, - startPos.translate(0, removedWords.count), - ); + // If the first part of the diff isn't an insertion, then the model is + // probably rewriting other parts of the line + return undefined; } } } else { From b84fdb95f807c57fb9ef9e6f9dee2237e46793bb Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 13 Dec 2024 08:53:56 -0800 Subject: [PATCH 11/15] disable completions when multi-select is on --- extensions/vscode/src/autocomplete/completionProvider.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extensions/vscode/src/autocomplete/completionProvider.ts b/extensions/vscode/src/autocomplete/completionProvider.ts index aa3880952..2a2f41a88 100644 --- a/extensions/vscode/src/autocomplete/completionProvider.ts +++ b/extensions/vscode/src/autocomplete/completionProvider.ts @@ -113,6 +113,12 @@ export class ContinueCompletionProvider return null; } + // Don't autocomplete with multi-cursor + const editor = vscode.window.activeTextEditor; + if (editor && editor.selections.length > 1) { + return null; + } + // If the text at the range isn't a prefix of the intellisense text, // no completion will be displayed, regardless of what we return if ( From 911cf72f6362ac5e91ef947e3ebde6ac3b678f28 Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 13 Dec 2024 09:00:15 -0800 Subject: [PATCH 12/15] fix tsc err --- core/autocomplete/filtering/test/util.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/core/autocomplete/filtering/test/util.ts b/core/autocomplete/filtering/test/util.ts index db8d99131..d1b94575e 100644 --- a/core/autocomplete/filtering/test/util.ts +++ b/core/autocomplete/filtering/test/util.ts @@ -54,6 +54,7 @@ export async function testAutocompleteFiltering( const line = prefix.split("\n").length - 1; const character = prefix.split("\n")[line].length; const autocompleteInput: AutocompleteInput = { + isUntitledFile: false, completionId: "test-completion-id", filepath, pos: { From 0d2ff0c7caf0c5e04b6b4160bdb427d13998b4b9 Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 13 Dec 2024 09:15:31 -0800 Subject: [PATCH 13/15] bump version --- .changes/unreleased/Changed-20241213-091505.yaml | 4 ++++ .changes/unreleased/Fixed-20241213-091454.yaml | 4 ++++ .changes/unreleased/Fixed-20241213-091519.yaml | 4 ++++ extensions/vscode/CHANGELOG.md | 7 +++++++ extensions/vscode/package.json | 2 +- 5 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .changes/unreleased/Changed-20241213-091505.yaml create mode 100644 .changes/unreleased/Fixed-20241213-091454.yaml create mode 100644 .changes/unreleased/Fixed-20241213-091519.yaml diff --git a/.changes/unreleased/Changed-20241213-091505.yaml b/.changes/unreleased/Changed-20241213-091505.yaml new file mode 100644 index 000000000..0ce6136ae --- /dev/null +++ b/.changes/unreleased/Changed-20241213-091505.yaml @@ -0,0 +1,4 @@ +project: extensions/vscode +kind: Changed +body: Improved autocomplete in untitled files +time: 2024-12-13T09:15:05.552877-08:00 diff --git a/.changes/unreleased/Fixed-20241213-091454.yaml b/.changes/unreleased/Fixed-20241213-091454.yaml new file mode 100644 index 000000000..fb8d92584 --- /dev/null +++ b/.changes/unreleased/Fixed-20241213-091454.yaml @@ -0,0 +1,4 @@ +project: extensions/vscode +kind: Fixed +body: Display more mid-line completions +time: 2024-12-13T09:14:54.808683-08:00 diff --git a/.changes/unreleased/Fixed-20241213-091519.yaml b/.changes/unreleased/Fixed-20241213-091519.yaml new file mode 100644 index 000000000..84a193224 --- /dev/null +++ b/.changes/unreleased/Fixed-20241213-091519.yaml @@ -0,0 +1,4 @@ +project: extensions/vscode +kind: Fixed +body: Restored syntax highlighting +time: 2024-12-13T09:15:19.485189-08:00 diff --git a/extensions/vscode/CHANGELOG.md b/extensions/vscode/CHANGELOG.md index 0a9868f14..cb5b8b4be 100644 --- a/extensions/vscode/CHANGELOG.md +++ b/extensions/vscode/CHANGELOG.md @@ -5,6 +5,13 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and is generated by [Changie](https://github.com/miniscruff/changie). +Pre-release Changes +### Changed +* Improved autocomplete in untitled files +### Fixed +* Display more mid-line completions +* Restored syntax highlighting + ## 0.8.62 - 2024-12-10 ### Added * Tool use diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 917f7d597..627c0c974 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -2,7 +2,7 @@ "name": "continue", "icon": "media/icon.png", "author": "Continue Dev, Inc", - "version": "0.9.244", + "version": "0.9.245", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" From 8d37e36968fc9d431dedf7baa44e9004279f62cf Mon Sep 17 00:00:00 2001 From: henry Date: Fri, 13 Dec 2024 13:00:57 -0600 Subject: [PATCH 14/15] close sidebar when opening full screen --- extensions/vscode/src/commands.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/vscode/src/commands.ts b/extensions/vscode/src/commands.ts index 943072271..39adc05b1 100644 --- a/extensions/vscode/src/commands.ts +++ b/extensions/vscode/src/commands.ts @@ -810,6 +810,7 @@ const getCommandsMap: ( ); vscode.commands.executeCommand("workbench.action.copyEditorToNewWindow"); + vscode.commands.executeCommand("workbench.action.closeAuxiliaryBar"); }, "continue.openConfig": () => { core.invoke("config/openProfile", { From a9327394c51c10b0e568ad53cf4bb3651e448978 Mon Sep 17 00:00:00 2001 From: henry Date: Fri, 13 Dec 2024 13:08:25 -0600 Subject: [PATCH 15/15] removed unused variables --- gui/src/components/History/index.tsx | 2 -- gui/src/components/Layout.tsx | 2 -- 2 files changed, 4 deletions(-) diff --git a/gui/src/components/History/index.tsx b/gui/src/components/History/index.tsx index 9c6bc054e..24ac376e3 100644 --- a/gui/src/components/History/index.tsx +++ b/gui/src/components/History/index.tsx @@ -23,8 +23,6 @@ export function History() { const [searchTerm, setSearchTerm] = useState(""); - const sessionTitle = useAppSelector((state) => state.session.title); - const minisearch = useRef( new MiniSearch({ fields: ["title"], diff --git a/gui/src/components/Layout.tsx b/gui/src/components/Layout.tsx index b183e24e4..78085b431 100644 --- a/gui/src/components/Layout.tsx +++ b/gui/src/components/Layout.tsx @@ -65,8 +65,6 @@ const Layout = () => { const showDialog = useAppSelector((state) => state.ui.showDialog); - const isStreaming = useAppSelector((state) => state.session.isStreaming); - useWebviewListener( "openDialogMessage", async (message) => {