diff --git a/core/autocomplete/CompletionProvider.ts b/core/autocomplete/CompletionProvider.ts index 3cc1ce65c..b2cfbd9d9 100644 --- a/core/autocomplete/CompletionProvider.ts +++ b/core/autocomplete/CompletionProvider.ts @@ -29,7 +29,7 @@ const autocompleteCache = AutocompleteLruCache.get(); const ERRORS_TO_IGNORE = [ // From Ollama "unexpected server status", - "operation was aborted" + "operation was aborted", ]; export type GetLspDefinitionsFunction = ( @@ -177,15 +177,22 @@ export class CompletionProvider { // or they might separately track recently edited ranges) const extraSnippets = await this._getExtraSnippets(helper); - const [snippets, diff, workspaceDirs] = await Promise.all([ - aggregateSnippets(helper, extraSnippets, this.contextRetrievalService), - this.ide.getDiff(true), - this.ide.getWorkspaceDirs(), - ]); + const [snippets, diff, clipboardContent, workspaceDirs] = + await Promise.all([ + aggregateSnippets( + helper, + extraSnippets, + this.contextRetrievalService, + ), + this.ide.getDiff(true), + this.ide.getClipboardContent(), + this.ide.getWorkspaceDirs(), + ]); const { prompt, prefix, suffix, completionOptions } = renderPrompt({ snippets, diff, + clipboardContent, workspaceDirs, helper, }); diff --git a/core/autocomplete/generation/ListenableGenerator.test.ts b/core/autocomplete/generation/ListenableGenerator.test.ts index 69797959e..9dc6cc893 100644 --- a/core/autocomplete/generation/ListenableGenerator.test.ts +++ b/core/autocomplete/generation/ListenableGenerator.test.ts @@ -17,7 +17,11 @@ describe("ListenableGenerator", () => { const source = asyncGenerator(values); const onError = jest.fn(); - const lg = new ListenableGenerator(source, onError); + const lg = new ListenableGenerator( + source, + onError, + new AbortController(), + ); const result: number[] = []; for await (const value of lg.tee()) { @@ -33,7 +37,11 @@ describe("ListenableGenerator", () => { const source = asyncGenerator(values, 10); // Introduce delay to simulate async behavior const onError = jest.fn(); - const lg = new ListenableGenerator(source, onError); + const lg = new ListenableGenerator( + source, + onError, + new AbortController(), + ); const listener = jest.fn(); @@ -57,7 +65,11 @@ describe("ListenableGenerator", () => { const source = asyncGenerator(values, 10); const onError = jest.fn(); - const lg = new ListenableGenerator(source, onError); + const lg = new ListenableGenerator( + source, + onError, + new AbortController(), + ); const initialListener = jest.fn(); @@ -87,7 +99,11 @@ describe("ListenableGenerator", () => { const source = asyncGenerator(values, 10); const onError = jest.fn(); - const lg = new ListenableGenerator(source, onError); + const lg = new ListenableGenerator( + source, + onError, + new AbortController(), + ); const result: number[] = []; const teeIterator = lg.tee(); @@ -116,7 +132,11 @@ describe("ListenableGenerator", () => { const source = errorGenerator(); const onError = jest.fn(); - const lg = new ListenableGenerator(source, onError); + const lg = new ListenableGenerator( + source, + onError, + new AbortController(), + ); const result: number[] = []; for await (const value of lg.tee()) { @@ -133,7 +153,11 @@ describe("ListenableGenerator", () => { const source = asyncGenerator(values); const onError = jest.fn(); - const lg = new ListenableGenerator(source, onError); + const lg = new ListenableGenerator( + source, + onError, + new AbortController(), + ); const listener = jest.fn(); lg.listen(listener); diff --git a/core/autocomplete/templating/index.ts b/core/autocomplete/templating/index.ts index f847e3b2a..6f95923d1 100644 --- a/core/autocomplete/templating/index.ts +++ b/core/autocomplete/templating/index.ts @@ -13,21 +13,24 @@ import { import { getStopTokens } from "./getStopTokens"; import { countTokens } from "../../llm/countTokens"; +const addCommentMarks = (text: string, language: AutocompleteLanguageInfo) => { + const comment = language.singleLineComment; + const lines = [ + ...text + .trim() + .split("\n") + .map((line) => `${comment} ${line}`), + ]; + return lines.join("\n"); +}; + export function formatExternalSnippet( filepath: string, snippet: string, language: AutocompleteLanguageInfo, ) { - const comment = language.singleLineComment; - const lines = [ - `${comment} Path: ${getBasename(filepath)}`, - ...snippet - .trim() - .split("\n") - .map((line) => `${comment} ${line}`), - comment, - ]; - return lines.join("\n"); + const filePathString = `Path: ${getBasename(filepath)}\n`; + return addCommentMarks(`${filePathString}${snippet}`, language); } function getContextComments( @@ -35,14 +38,21 @@ function getContextComments( lang: AutocompleteLanguageInfo, filepath: string, ) { + if (snippets.length === 0) { + return ""; + } + + const headerSnipper = `\n\n${lang.singleLineComment} Related code:\n`; const fileNameSnippet = `\n\n${lang.singleLineComment} ${getLastNPathParts(filepath, 2)}\n\n`; const formattedSnippets = + headerSnipper + snippets .map((snippet) => formatExternalSnippet(snippet.filepath, snippet.contents, lang), ) - .join("\n") + fileNameSnippet; + .join("\n") + + fileNameSnippet; return formattedSnippets; } @@ -90,16 +100,51 @@ const formatDiff = (helper: HelperVars, diff?: string) => { return `${diff}\n\n`; }; +const MAX_CLIPBOARD_AGE = 5 * 60 * 1000; + +const formatClipboardContent = ( + helper: HelperVars, + { text, copiedAt }: { text: string; copiedAt: string }, +) => { + const currDate = new Date(); + + const isTooOld = + currDate.getTime() - new Date(copiedAt).getTime() > MAX_CLIPBOARD_AGE; + + if (isTooOld) { + return ""; + } + + const tokenCount = countTokens(text, helper.modelName); + const isTooLong = tokenCount > helper.maxClipboardTokens; + + if (isTooLong) { + return ""; + } + + return ( + addCommentMarks( + `Recently copied by user:${text.includes("\n") ? "\n" : ""} ${text}`, + helper.lang, + ) + "\n" + ); +}; + export function renderPrompt({ snippets, workspaceDirs, helper, diff, + clipboardContent, }: { snippets: AutocompleteSnippet[]; workspaceDirs: string[]; helper: HelperVars; diff?: string; + clipboardContent: { + text: string; + copiedAt: string; + }; }): { prompt: string; prefix: string; @@ -132,8 +177,11 @@ export function renderPrompt({ helper.filepath, ); const formattedDiff = formatDiff(helper, diff); + const formattedClipboard = formatClipboardContent(helper, clipboardContent); - prefix = `${formattedDiff}${contextComments}${prefix}`; + prefix = [formattedClipboard, formattedDiff, contextComments, prefix].join( + "", + ); } const prompt = diff --git a/core/autocomplete/util/HelperVars.ts b/core/autocomplete/util/HelperVars.ts index 190e9b8ec..c5429fe81 100644 --- a/core/autocomplete/util/HelperVars.ts +++ b/core/autocomplete/util/HelperVars.ts @@ -122,6 +122,10 @@ export class HelperVars { return this.options.maxPromptTokens * this.options.maxDiffPercentage; } + get maxClipboardTokens() { + return this.options.maxPromptTokens * this.options.maxClipboardPercentage; + } + get prunedCaretWindow() { return this.prunedPrefix + this.prunedSuffix; } diff --git a/core/config/ConfigHandler.ts b/core/config/ConfigHandler.ts index bd615f2e0..3eb55643f 100644 --- a/core/config/ConfigHandler.ts +++ b/core/config/ConfigHandler.ts @@ -12,6 +12,7 @@ import { } from "../index.js"; import Ollama from "../llm/llms/Ollama.js"; import { GlobalContext } from "../util/GlobalContext.js"; +import { getConfigJsonPath } from "../util/paths.js"; import { ConfigResult } from "./load.js"; import { @@ -84,6 +85,18 @@ export class ConfigHandler { return this.profiles.filter((p) => p.profileId !== this.selectedProfileId); } + async openConfigProfile(profileId?: string) { + let openProfileId = profileId || this.selectedProfileId; + if (openProfileId === "local") { + await this.ide.openFile(getConfigJsonPath()); + } else { + await this.ide.openUrl( + "https://app.continue.dev/", + // `https://app.continue.dev/workspaces/${openProfileId}/chat`, + ); + } + } + private async fetchControlPlaneProfiles() { // Get the profiles and create their lifecycle managers this.controlPlaneClient diff --git a/core/config/types.ts b/core/config/types.ts index 370689dde..f397b1ed7 100644 --- a/core/config/types.ts +++ b/core/config/types.ts @@ -837,6 +837,7 @@ declare global { slidingWindowSize: number; maxSnippetPercentage: number; maxDiffPercentage: number; + maxClipboardPercentage: number; useCache: boolean; onlyMyCode: boolean; useOtherFiles: boolean; diff --git a/core/core.ts b/core/core.ts index 6510add64..c6b336c7d 100644 --- a/core/core.ts +++ b/core/core.ts @@ -28,7 +28,11 @@ import { DevDataSqliteDb } from "./util/devdataSqlite"; import { fetchwithRequestOptions } from "./util/fetchWithOptions"; import { GlobalContext } from "./util/GlobalContext"; import historyManager from "./util/history"; -import { editConfigJson, setupInitialDotContinueDirectory } from "./util/paths"; +import { + editConfigJson, + getConfigJsonPath, + setupInitialDotContinueDirectory, +} from "./util/paths"; import { Telemetry } from "./util/posthog"; import { getSymbolsForManyFiles } from "./util/treeSitter"; import { TTS } from "./util/tts"; @@ -264,6 +268,10 @@ export class Core { await this.configHandler.reloadConfig(); }); + on("config/openProfile", async (msg) => { + await this.configHandler.openConfigProfile(msg.data.profileId); + }); + on("config/reload", (msg) => { void this.configHandler.reloadConfig(); return this.configHandler.getSerializedConfig(); diff --git a/core/index.d.ts b/core/index.d.ts index ce2e59449..0646edc54 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -106,7 +106,7 @@ export interface ILLM extends LLMOptions { complete( prompt: string, signal: AbortSignal, - options?: LLMFullCompletionOptions + options?: LLMFullCompletionOptions, ): Promise; streamComplete( @@ -508,6 +508,7 @@ export interface IDE { getIdeInfo(): Promise; getIdeSettings(): Promise; getDiff(includeUnstaged: boolean): Promise; + getClipboardContent(): Promise<{ text: string; copiedAt: string }>; isTelemetryEnabled(): Promise; getUniqueId(): Promise; getTerminalContents(): Promise; @@ -525,6 +526,7 @@ export interface IDE { showVirtualFile(title: string, contents: string): Promise; getContinueDir(): Promise; openFile(path: string): Promise; + openUrl(url: string): Promise; runCommand(command: string): Promise; saveFile(filepath: string): Promise; readFile(filepath: string): Promise; @@ -979,6 +981,7 @@ export interface TabAutocompleteOptions { slidingWindowSize: number; maxSnippetPercentage: number; maxDiffPercentage: number; + maxClipboardPercentage: number; useCache: boolean; onlyMyCode: boolean; useOtherFiles: boolean; diff --git a/core/protocol/core.ts b/core/protocol/core.ts index a53ef3f2b..c757e5d34 100644 --- a/core/protocol/core.ts +++ b/core/protocol/core.ts @@ -69,6 +69,7 @@ export type ToCoreFromIdeOrWebviewProtocol = { "config/deleteModel": [{ title: string }, void]; "config/reload": [undefined, BrowserSerializedContinueConfig]; "config/listProfiles": [undefined, ProfileDescription[]]; + "config/openProfile": [{ profileId: string | undefined }, void]; "context/getContextItems": [ { name: string; diff --git a/core/protocol/ide.ts b/core/protocol/ide.ts index a9b1d8cf9..75f53d5a7 100644 --- a/core/protocol/ide.ts +++ b/core/protocol/ide.ts @@ -28,6 +28,7 @@ export type ToIdeFromWebviewOrCoreProtocol = { showVirtualFile: [{ name: string; content: string }, void]; getContinueDir: [undefined, string]; openFile: [{ path: string }, void]; + openUrl: [string, void]; runCommand: [{ command: string }, void]; getSearchResults: [{ query: string }, string]; subprocess: [{ command: string; cwd?: string }, [string, string]]; @@ -49,11 +50,17 @@ export type ToIdeFromWebviewOrCoreProtocol = { ]; getProblems: [{ filepath: string }, Problem[]]; getOpenFiles: [undefined, string[]]; - getCurrentFile: [undefined, undefined | { - isUntitled: boolean; - path: string; - contents: string; - }]; + getCurrentFile: [ + undefined, + ( + | undefined + | { + isUntitled: boolean; + path: string; + contents: string; + } + ), + ]; getPinnedFiles: [undefined, string[]]; showLines: [{ filepath: string; startLine: number; endLine: number }, void]; readRangeInFile: [{ filepath: string; range: Range }, string]; diff --git a/core/protocol/ideWebview.ts b/core/protocol/ideWebview.ts index c833c3a7a..1d18e1a6f 100644 --- a/core/protocol/ideWebview.ts +++ b/core/protocol/ideWebview.ts @@ -30,7 +30,6 @@ export type ToIdeFromWebviewProtocol = ToIdeFromWebviewOrCoreProtocol & { overwriteFile: [{ filepath: string; prevFileContent: string | null }, void]; showTutorial: [undefined, void]; showFile: [{ filepath: string }, void]; - openConfigJson: [undefined, void]; toggleDevTools: [undefined, void]; reloadWindow: [undefined, void]; focusEditor: [undefined, void]; @@ -101,7 +100,6 @@ export type ToWebviewFromIdeProtocol = ToWebviewFromIdeOrCoreProtocol & { navigateTo: [{ path: string; toggle?: boolean }, void]; addModel: [undefined, void]; - openSettings: [undefined, void]; /** * @deprecated Use navigateTo with a path instead. */ diff --git a/core/protocol/passThrough.ts b/core/protocol/passThrough.ts index 7a1392617..40d537d41 100644 --- a/core/protocol/passThrough.ts +++ b/core/protocol/passThrough.ts @@ -21,6 +21,8 @@ export const WEBVIEW_TO_CORE_PASS_THROUGH: (keyof ToCoreFromWebviewProtocol)[] = "config/getSerializedProfileInfo", "config/deleteModel", "config/reload", + "config/listProfiles", + "config/openProfile", "context/getContextItems", "context/getSymbolsForFiles", "context/loadSubmenuItems", @@ -53,7 +55,6 @@ export const WEBVIEW_TO_CORE_PASS_THROUGH: (keyof ToCoreFromWebviewProtocol)[] = // "completeOnboarding", "addAutocompleteModel", - "config/listProfiles", "profiles/switch", "didChangeSelectedProfile", ]; @@ -71,4 +72,6 @@ export const CORE_TO_WEBVIEW_PASS_THROUGH: (keyof ToWebviewFromCoreProtocol)[] = "didChangeAvailableProfiles", "setTTSActive", "getWebviewHistoryLength", + "signInToControlPlane", + "openDialogMessage", ]; diff --git a/core/protocol/webview.ts b/core/protocol/webview.ts index d259fde9e..0dcdb047f 100644 --- a/core/protocol/webview.ts +++ b/core/protocol/webview.ts @@ -23,4 +23,6 @@ export type ToWebviewFromIdeOrCoreProtocol = { ]; setTTSActive: [boolean, void]; getWebviewHistoryLength: [undefined, number]; + signInToControlPlane: [undefined, void]; + openDialogMessage: ["account", void]; }; diff --git a/core/test/llm.test.ts b/core/test/llm.test.ts index 2cb81da72..cf42e128a 100644 --- a/core/test/llm.test.ts +++ b/core/test/llm.test.ts @@ -26,9 +26,10 @@ function testLLM(llm: BaseLLM) { describe(llm.providerName, () => { test("Stream Chat works", async () => { let total = ""; - for await (const chunk of llm.streamChat([ - { role: "user", content: "Hi" }, - ])) { + for await (const chunk of llm.streamChat( + [{ role: "user", content: "Hi" }], + new AbortController().signal, + )) { total += chunk.content; } @@ -38,7 +39,10 @@ function testLLM(llm: BaseLLM) { test("Stream Complete works", async () => { let total = ""; - for await (const chunk of llm.streamComplete("Hi")) { + for await (const chunk of llm.streamComplete( + "Hi", + new AbortController().signal, + )) { total += chunk; } @@ -47,7 +51,7 @@ function testLLM(llm: BaseLLM) { }); test("Complete works", async () => { - const completion = await llm.complete("Hi"); + const completion = await llm.complete("Hi", new AbortController().signal); expect(completion.length).toBeGreaterThan(0); return; diff --git a/core/util/filesystem.ts b/core/util/filesystem.ts index 42900edb5..5041ceb8e 100644 --- a/core/util/filesystem.ts +++ b/core/util/filesystem.ts @@ -129,6 +129,10 @@ class FileSystemIde implements IDE { return Promise.resolve(""); } + getClipboardContent(): Promise<{ text: string; copiedAt: string }> { + return Promise.resolve({ text: "", copiedAt: new Date().toISOString() }); + } + getTerminalContents(): Promise { return Promise.resolve(""); } @@ -187,6 +191,10 @@ class FileSystemIde implements IDE { return Promise.resolve(); } + openUrl(url: string): Promise { + return Promise.resolve(); + } + runCommand(command: string): Promise { return Promise.resolve(); } diff --git a/core/util/messageIde.ts b/core/util/messageIde.ts index b157a1078..4c2709f23 100644 --- a/core/util/messageIde.ts +++ b/core/util/messageIde.ts @@ -28,7 +28,7 @@ export class MessageIde implements IDE { messageType: T, callback: (data: FromIdeProtocol[T][0]) => FromIdeProtocol[T][1], ) => void, - ) { } + ) {} pathSep(): Promise { return this.request("pathSep", undefined); @@ -113,6 +113,13 @@ export class MessageIde implements IDE { return await this.request("getDiff", { includeUnstaged }); } + async getClipboardContent(): Promise<{ text: string; copiedAt: string }> { + return { + text: "", + copiedAt: new Date().toISOString(), + }; + } + async getTerminalContents() { return await this.request("getTerminalContents", undefined); } @@ -156,6 +163,10 @@ export class MessageIde implements IDE { await this.request("openFile", { path }); } + async openUrl(url: string): Promise { + await this.request("openUrl", url); + } + async runCommand(command: string): Promise { await this.request("runCommand", { command }); } diff --git a/core/util/parameters.ts b/core/util/parameters.ts index 269f3489e..20b96ac47 100644 --- a/core/util/parameters.ts +++ b/core/util/parameters.ts @@ -13,6 +13,7 @@ export const DEFAULT_AUTOCOMPLETE_OPTS: TabAutocompleteOptions = { slidingWindowSize: 500, maxSnippetPercentage: 0.5, maxDiffPercentage: 0.5, + maxClipboardPercentage: 0.5, // yes the percentages do not add up useCache: true, onlyMyCode: true, useOtherFiles: true, diff --git a/core/util/paths.ts b/core/util/paths.ts index d606f095d..3ff5251e6 100644 --- a/core/util/paths.ts +++ b/core/util/paths.ts @@ -1,7 +1,7 @@ import * as fs from "fs"; import * as os from "os"; +import { pathToFileURL } from "url"; import * as path from "path"; - import * as JSONC from "comment-json"; import dotenv from "dotenv"; @@ -41,6 +41,9 @@ export function getGlobalContinueIgnorePath(): string { return continueIgnorePath; } +/* + Deprecated, replace with getContinueGlobalUri where possible +*/ export function getContinueGlobalPath(): string { // This is ~/.continue on mac/linux const continuePath = CONTINUE_GLOBAL_DIR; @@ -50,6 +53,10 @@ export function getContinueGlobalPath(): string { return continuePath; } +export function getContinueGlobalUri(): string { + return pathToFileURL(CONTINUE_GLOBAL_DIR).href; +} + export function getSessionsFolderPath(): string { const sessionsPath = path.join(getContinueGlobalPath(), "sessions"); if (!fs.existsSync(sessionsPath)) { @@ -94,6 +101,10 @@ export function getConfigJsonPath(ideType: IdeType = "vscode"): string { return p; } +export function getConfigJsonUri(): string { + return getContinueGlobalUri() + "/config.json"; +} + export function getConfigTsPath(): string { const p = path.join(getContinueGlobalPath(), "config.ts"); if (!fs.existsSync(p)) { diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteService.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteService.kt index cddf5769d..777df65ce 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteService.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteService.kt @@ -129,6 +129,13 @@ class AutocompleteService(private val project: Project) { document.getText(com.intellij.openapi.util.TextRange(caretOffset, document.textLength)) } + // Determine the index of a newline character within the text following the cursor. + val newlineIndex = textAfterCursor.indexOf("\r\n").takeIf { it >= 0 } ?: textAfterCursor.indexOf('\n') + // If a newline character is found and the current line is not empty, truncate the text at that point. + if (newlineIndex > 0) { + textAfterCursor = textAfterCursor.substring(0, newlineIndex) + } + val indexOfTextAfterCursorInCompletion = completion.indexOf(textAfterCursor) if (indexOfTextAfterCursorInCompletion > 0) { return@runReadAction completion.slice(0..indexOfTextAfterCursorInCompletion - 1) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt index fc51a392e..659ec4998 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt @@ -192,9 +192,6 @@ class ContinueBrowser(val project: Project, url: String) { } "reloadWindow" -> {} - "openConfigJson" -> { - ide?.setFileOpen(getConfigJsonPath()) - } "readRangeInFile" -> { val data = data.asJsonObject diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 3dc6757e7..940503505 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.9.231", + "version": "0.9.232", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "0.9.231", + "version": "0.9.232", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index ef2d12c82..939638b16 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.232", + "version": "0.9.233", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" @@ -219,9 +219,10 @@ "group": "Continue" }, { - "command": "continue.openConfigJson", + "command": "continue.openConfig", "category": "Continue", - "title": "Open config.json", + "title": "Open Continue Config", + "icon": "$(gear)", "group": "Continue" }, { @@ -250,12 +251,25 @@ "icon": "$(history)", "group": "Continue" }, + { + "command": "continue.viewLogs", + "category": "Continue", + "title": "View History", + "group": "Continue" + }, { "command": "continue.navigateTo", "category": "Continue", "title": "Navigate to a path", "group": "Continue" }, + { + "command": "continue.openMorePage", + "category": "Continue", + "title": "More", + "icon": "$(ellipsis)", + "group": "Continue" + }, { "command": "continue.writeCommentsForCode", "category": "Continue", @@ -315,6 +329,20 @@ "category": "Continue", "title": "Focus Continue Chat", "group": "Continue" + }, + { + "command": "continue.signInToControlPlane", + "title": "Sign In", + "category": "Continue", + "group": "Continue", + "icon": "$(account)" + }, + { + "command": "continue.openAccountDialog", + "title": "Account", + "category": "Continue", + "group": "Continue", + "icon": "$(account)" } ], "keybindings": [ @@ -492,6 +520,26 @@ "command": "continue.toggleFullScreen", "group": "navigation@3", "when": "view == continue.continueGUIView" + }, + { + "command": "continue.openConfig", + "group": "navigation@4", + "when": "view == continue.continueGUIView" + }, + { + "command": "continue.signInToControlPlane", + "group": "navigation@5", + "when": "(view == continue.continueGUIView) && config.continue.enableContinueForTeams && !continue.isSignedInToControlPlane" + }, + { + "command": "continue.openAccountDialog", + "group": "navigation@5", + "when": "(view == continue.continueGUIView) && config.continue.enableContinueForTeams && continue.isSignedInToControlPlane" + }, + { + "command": "continue.openMorePage", + "group": "navigation@6", + "when": "view == continue.continueGUIView" } ], "editor/title": [ diff --git a/extensions/vscode/src/ContinueGUIWebviewViewProvider.ts b/extensions/vscode/src/ContinueGUIWebviewViewProvider.ts index 8c8c399a7..610d262fc 100644 --- a/extensions/vscode/src/ContinueGUIWebviewViewProvider.ts +++ b/extensions/vscode/src/ContinueGUIWebviewViewProvider.ts @@ -168,7 +168,15 @@ export class ContinueGUIWebviewViewProvider const currentTheme = getTheme(); vscode.workspace.onDidChangeConfiguration((e) => { - if (e.affectsConfiguration("workbench.colorTheme")) { + if ( + e.affectsConfiguration("workbench.colorTheme") || + e.affectsConfiguration("window.autoDetectColorScheme") || + e.affectsConfiguration("window.autoDetectHighContrast") || + e.affectsConfiguration("workbench.preferredDarkColorTheme") || + e.affectsConfiguration("workbench.preferredLightColorTheme") || + e.affectsConfiguration("workbench.preferredHighContrastColorTheme") || + e.affectsConfiguration("workbench.preferredHighContrastLightColorTheme") + ) { // Send new theme to GUI to update embedded Monaco themes this.webviewProtocol?.request("setTheme", { theme: getTheme() }); } @@ -188,7 +196,7 @@ export class ContinueGUIWebviewViewProvider
- + ${ inDevelopmentMode ? `