From fb6a80433c5747da97dfef388a6bb0abf86d6958 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Tue, 26 Aug 2025 16:40:07 +0530 Subject: [PATCH 1/7] remove vscode quick actions --- extensions/vscode/src/activation/activate.ts | 2 - .../vscode/src/lang-server/codeActions.ts | 63 ------------------- 2 files changed, 65 deletions(-) delete mode 100644 extensions/vscode/src/lang-server/codeActions.ts diff --git a/extensions/vscode/src/activation/activate.ts b/extensions/vscode/src/activation/activate.ts index 19be7545e..6f4275f67 100644 --- a/extensions/vscode/src/activation/activate.ts +++ b/extensions/vscode/src/activation/activate.ts @@ -3,7 +3,6 @@ import { Telemetry } from "core/util/posthog"; import * as vscode from "vscode"; import { VsCodeExtension } from "../extension/VsCodeExtension"; -import registerQuickFixProvider from "../lang-server/codeActions"; import { getExtensionVersion, isUnsupportedPlatform } from "../util/util"; import { GlobalContext } from "core/util/GlobalContext"; @@ -41,7 +40,6 @@ export async function activateExtension(context: vscode.ExtensionContext) { getContinueRcPath(); // Register commands and providers - registerQuickFixProvider(); setupInlineTips(context); const vscodeExtension = new VsCodeExtension(context); diff --git a/extensions/vscode/src/lang-server/codeActions.ts b/extensions/vscode/src/lang-server/codeActions.ts deleted file mode 100644 index f39d5b926..000000000 --- a/extensions/vscode/src/lang-server/codeActions.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { EXTENSION_NAME } from "core/control-plane/env"; -import * as vscode from "vscode"; - -class ContinueQuickFixProvider implements vscode.CodeActionProvider { - public static readonly providedCodeActionKinds = [ - vscode.CodeActionKind.QuickFix, - ]; - - provideCodeActions( - document: vscode.TextDocument, - range: vscode.Range | vscode.Selection, - context: vscode.CodeActionContext, - token: vscode.CancellationToken, - ): vscode.ProviderResult<(vscode.Command | vscode.CodeAction)[]> { - if (context.diagnostics.length === 0) { - return []; - } - - const diagnostic = context.diagnostics[0]; - - const quickFix = new vscode.CodeAction( - "Ask Continue", - vscode.CodeActionKind.QuickFix, - ); - - quickFix.isPreferred = false; - - const surroundingRange = new vscode.Range( - Math.max(0, range.start.line - 3), - 0, - Math.min(document.lineCount, range.end.line + 3), - 0, - ); - - quickFix.command = { - command: "continue.quickFix", - title: "Continue Quick Fix", - arguments: [surroundingRange, diagnostic.message], - }; - - return [quickFix]; - } -} - -export default function registerQuickFixProvider() { - const isDisabled = - !!vscode.workspace - .getConfiguration(EXTENSION_NAME) - .get("disableQuickFix") === true; - - if (isDisabled) { - return; - } - - // In your extension's activate function: - vscode.languages.registerCodeActionsProvider( - { language: "*" }, - new ContinueQuickFixProvider(), - { - providedCodeActionKinds: ContinueQuickFixProvider.providedCodeActionKinds, - }, - ); -} From 469d29dc0e9828e3a64c6483dce9cf57c327bd05 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Tue, 26 Aug 2025 17:14:40 +0530 Subject: [PATCH 2/7] remove contextmenuprompts experimental config - also remove json reference docs --- core/config/types.ts | 1 - core/index.d.ts | 1 - docs/reference/json-reference.mdx | 7 ------- extensions/vscode/config_schema.json | 25 ------------------------- extensions/vscode/src/commands.ts | 28 +++++++++------------------- 5 files changed, 9 insertions(+), 53 deletions(-) diff --git a/core/config/types.ts b/core/config/types.ts index 6048cf4d3..f06820d5d 100644 --- a/core/config/types.ts +++ b/core/config/types.ts @@ -1104,7 +1104,6 @@ declare global { }; interface ExperimentalConfig { - contextMenuPrompts?: ContextMenuConfig; modelRoles?: ExperimentalModelRoles; defaultContext?: DefaultContextProvider[]; promptPath?: string; diff --git a/core/index.d.ts b/core/index.d.ts index 10966f084..5478cb9a5 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -1532,7 +1532,6 @@ export type DefaultContextProvider = ContextProviderWithParams & { }; export interface ExperimentalConfig { - contextMenuPrompts?: ContextMenuConfig; modelRoles?: ExperimentalModelRoles; defaultContext?: DefaultContextProvider[]; promptPath?: string; diff --git a/docs/reference/json-reference.mdx b/docs/reference/json-reference.mdx index fa57ed5a8..d5fbf30c3 100644 --- a/docs/reference/json-reference.mdx +++ b/docs/reference/json-reference.mdx @@ -491,13 +491,6 @@ Several experimental config parameters are available, as described below: - `prompt` (**required**): Prompt for quick action. - `sendToChat`: If `true`, sends result to chat; else inserts in document. Default is `false`. -- `contextMenuPrompts`: - - - `comment`: Prompt for commenting code. - - `docstring`: Prompt for adding docstrings. - - `fix`: Prompt for fixing code. - - `optimize`: Prompt for optimizing code. - - `modelContextProtocolServers`: See [Model Context Protocol](/customize/deep-dives/mcp) Example diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index 86675a1ac..240199300 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -3436,31 +3436,6 @@ }, "description": "Quick actions are a way to add custom commands to the Code Lens of function and class declarations." }, - "contextMenuPrompts": { - "type": "object", - "properties": { - "comment": { - "type": "string", - "default": "Write comments for this code. Do not change anything about the code itself." - }, - "docstring": { - "type": "string", - "default": "Write a docstring for this code. Do not change anything about the code itself." - }, - "fix": { - "type": "string", - "default": "Fix this code" - }, - "optimize": { - "type": "string", - "default": "Optimize this code" - }, - "fixGrammar": { - "type": "string", - "default": "If there are any grammar or spelling mistakes in this writing, fix them. Do not make other large changes to the writing." - } - } - }, "useChromiumForDocsCrawling": { "type": "boolean", "description": "Use Chromium to crawl docs locally. Useful if the default Cheerio crawler fails on sites that require JavaScript rendering. Downloads and installs Chromium to `~/.continue/.utils`.", diff --git a/extensions/vscode/src/commands.ts b/extensions/vscode/src/commands.ts index cd75d24bd..cfe1061da 100644 --- a/extensions/vscode/src/commands.ts +++ b/extensions/vscode/src/commands.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/naming-convention */ import * as fs from "node:fs"; -import { ContextMenuConfig, ILLM, ModelInstaller } from "core"; +import { ILLM, ModelInstaller } from "core"; import { CompletionProvider } from "core/autocomplete/CompletionProvider"; import { ConfigHandler } from "core/config/ConfigHandler"; import { EXTENSION_NAME } from "core/control-plane/env"; @@ -140,16 +140,11 @@ const getCommandsMap: ( * increments the FTC count, and then streams an edit to the * vertical diff manager. * - * @param promptName - The key for the prompt in the context menu configuration. - * @param fallbackPrompt - The prompt to use if the configured prompt is not available. + * @param input - The prompt to use if the configured prompt is not available. * @param [range] - Optional. The range to edit if provided. * @returns */ - async function streamInlineEdit( - promptName: keyof ContextMenuConfig, - fallbackPrompt: string, - range?: vscode.Range, - ) { + async function streamInlineEdit(input: string, range?: vscode.Range) { const { config } = await configHandler.loadConfig(); if (!config) { throw new Error("Config not loaded"); @@ -165,8 +160,7 @@ const getCommandsMap: ( void sidebar.webviewProtocol.request("incrementFtc", undefined); await verticalDiffManager.streamEdit({ - input: - config.experimental?.contextMenuPrompts?.[promptName] ?? fallbackPrompt, + input, llm, range, rulesToInclude: config.rules, @@ -240,7 +234,7 @@ const getCommandsMap: ( ) => { captureCommandTelemetry("customQuickActionStreamInlineEdit"); - streamInlineEdit("docstring", prompt, range); + void streamInlineEdit(prompt, range); }, "continue.codebaseForceReIndex": async () => { core.invoke("index/forceReIndex", undefined); @@ -349,8 +343,7 @@ const getCommandsMap: ( "continue.writeCommentsForCode": async () => { captureCommandTelemetry("writeCommentsForCode"); - streamInlineEdit( - "comment", + void streamInlineEdit( "Write comments for this code. Do not change anything about the code itself.", ); }, @@ -358,26 +351,23 @@ const getCommandsMap: ( captureCommandTelemetry("writeDocstringForCode"); void streamInlineEdit( - "docstring", "Write a docstring for this code. Do not change anything about the code itself.", ); }, "continue.fixCode": async () => { captureCommandTelemetry("fixCode"); - streamInlineEdit( - "fix", + void streamInlineEdit( "Fix this code. If it is already 100% correct, simply rewrite the code.", ); }, "continue.optimizeCode": async () => { captureCommandTelemetry("optimizeCode"); - streamInlineEdit("optimize", "Optimize this code"); + void streamInlineEdit("Optimize this code"); }, "continue.fixGrammar": async () => { captureCommandTelemetry("fixGrammar"); - streamInlineEdit( - "fixGrammar", + void streamInlineEdit( "If there are any grammar or spelling mistakes in this writing, fix them. Do not make other large changes to the writing.", ); }, From 2bbde54ddcd289b68e8d229ecc675856f26599b6 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Tue, 26 Aug 2025 17:30:10 +0530 Subject: [PATCH 3/7] replace context menu actions with chat and edit --- extensions/vscode/package.json | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index af10a7043..0373212eb 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -178,7 +178,7 @@ { "command": "continue.focusEdit", "category": "Continue", - "title": "Edit Highlighted Code", + "title": "Add to Edit", "group": "Continue" }, { @@ -190,7 +190,7 @@ { "command": "continue.focusContinueInputWithoutClear", "category": "Continue", - "title": "Add Highlighted Code to Context", + "title": "Add to Chat", "group": "Continue" }, { @@ -532,31 +532,6 @@ "command": "continue.focusEdit", "group": "Continue", "when": "editorHasSelection && !editorReadonly" - }, - { - "command": "continue.writeCommentsForCode", - "group": "Continue", - "when": "editorHasSelection && !editorReadonly" - }, - { - "command": "continue.writeDocstringForCode", - "group": "Continue", - "when": "editorHasSelection && !editorReadonly" - }, - { - "command": "continue.fixCode", - "group": "Continue", - "when": "editorHasSelection && !editorReadonly" - }, - { - "command": "continue.optimizeCode", - "group": "Continue", - "when": "editorHasSelection && !editorReadonly" - }, - { - "command": "continue.fixGrammar", - "group": "Continue", - "when": "editorHasSelection && editorLangId == 'markdown' && !editorReadonly" } ], "explorer/context": [ From 981bf13452dd7f3fce273f97c46afefcfd3ff476 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Tue, 26 Aug 2025 17:32:21 +0530 Subject: [PATCH 4/7] remove debug actions and code fixes shortcuts --- docs/customize/deep-dives/vscode-actions.mdx | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/docs/customize/deep-dives/vscode-actions.mdx b/docs/customize/deep-dives/vscode-actions.mdx index 91ca32d59..5cc23a4f5 100644 --- a/docs/customize/deep-dives/vscode-actions.mdx +++ b/docs/customize/deep-dives/vscode-actions.mdx @@ -26,19 +26,3 @@ The highlighted code you’ve selected will be included in your prompt alongside Right click actions that generate inline diffs use the same prompt and response processing logic as [Edit](../../features/edit/how-it-works). ![context-menu](/images/context-menu.png) - -## How to Use the Debug Action Shortcut - -The debug action is a special built-in keyboard shortcut in the VS Code extension. Use cmd/ctrl + shift + R to instantly copy the contents of the most recent terminal output into the chat sidebar and get debugging advice. There is no additional, non-visible information sent to the language model. - -``` -I got the following error, can you please help explain how to fix it? - -[ERROR_MESSAGE] -``` - -## How to Use Quick Fixes for Code Errors - -Whenever you see red/yellow underlines in your code indicating errors, you can place your cursor nearby and VS Code will display a lightbulb icon. Either clicking the lightbulb or using the keyboard shortcut cmd/ctrl + . will show a dropdown menu of quick fixes. One of these will be the “Ask Continue” action. Either click or use cmd/ctrl + . again and Continue will attempt to help solve the problem. - -Similarly to the debug action, quick actions transparently inject a prompt into the chat window. When you select “Ask Continue”, the 3 lines above and below the error are sent to the chat followed by the question “How do I fix the following problem in the above code?: [ERROR_MESSAGE]”. From 51e586ce133c448279833b9ccfc5cf14d4a19003 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Fri, 29 Aug 2025 16:42:36 +0530 Subject: [PATCH 5/7] revert json-reference docs --- docs/reference/json-reference.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/reference/json-reference.mdx b/docs/reference/json-reference.mdx index 15541c61c..5960f07f8 100644 --- a/docs/reference/json-reference.mdx +++ b/docs/reference/json-reference.mdx @@ -485,6 +485,8 @@ Several experimental config parameters are available, as described below: - `applyCodeBlock`: Model title for applying code blocks. - `repoMapFileSelection`: Model title for repo map selections. + + - `modelContextProtocolServers`: See [Model Context Protocol](/customize/deep-dives/mcp) Example @@ -538,3 +540,5 @@ Some deprecated `config.json` settings are no longer stored in config and have b - `codeWrap` - `displayRawMarkdown` - `showChatScrollbar` + + From 945b31b634331686b8d5ebf80bf6a6d9fe026a92 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Fri, 29 Aug 2025 16:52:36 +0530 Subject: [PATCH 6/7] revert contextmenuprompts --- core/config/types.ts | 1 + core/index.d.ts | 1 + extensions/vscode/config_schema.json | 25 ++++++++++++++++++++++++ extensions/vscode/package.json | 29 ++++++++++++++++++++++++++-- extensions/vscode/src/commands.ts | 28 ++++++++++++++++++--------- 5 files changed, 73 insertions(+), 11 deletions(-) diff --git a/core/config/types.ts b/core/config/types.ts index f06820d5d..6048cf4d3 100644 --- a/core/config/types.ts +++ b/core/config/types.ts @@ -1104,6 +1104,7 @@ declare global { }; interface ExperimentalConfig { + contextMenuPrompts?: ContextMenuConfig; modelRoles?: ExperimentalModelRoles; defaultContext?: DefaultContextProvider[]; promptPath?: string; diff --git a/core/index.d.ts b/core/index.d.ts index 517e9cf56..7c3f4a121 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -1532,6 +1532,7 @@ export type DefaultContextProvider = ContextProviderWithParams & { }; export interface ExperimentalConfig { + contextMenuPrompts?: ContextMenuConfig; modelRoles?: ExperimentalModelRoles; defaultContext?: DefaultContextProvider[]; promptPath?: string; diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index 240199300..86675a1ac 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -3436,6 +3436,31 @@ }, "description": "Quick actions are a way to add custom commands to the Code Lens of function and class declarations." }, + "contextMenuPrompts": { + "type": "object", + "properties": { + "comment": { + "type": "string", + "default": "Write comments for this code. Do not change anything about the code itself." + }, + "docstring": { + "type": "string", + "default": "Write a docstring for this code. Do not change anything about the code itself." + }, + "fix": { + "type": "string", + "default": "Fix this code" + }, + "optimize": { + "type": "string", + "default": "Optimize this code" + }, + "fixGrammar": { + "type": "string", + "default": "If there are any grammar or spelling mistakes in this writing, fix them. Do not make other large changes to the writing." + } + } + }, "useChromiumForDocsCrawling": { "type": "boolean", "description": "Use Chromium to crawl docs locally. Useful if the default Cheerio crawler fails on sites that require JavaScript rendering. Downloads and installs Chromium to `~/.continue/.utils`.", diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index c32e9ec0e..8054468a9 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -183,7 +183,7 @@ { "command": "continue.focusEdit", "category": "Continue", - "title": "Add to Edit", + "title": "Edit Highlighted Code", "group": "Continue" }, { @@ -195,7 +195,7 @@ { "command": "continue.focusContinueInputWithoutClear", "category": "Continue", - "title": "Add to Chat", + "title": "Add Highlighted Code to Context", "group": "Continue" }, { @@ -547,6 +547,31 @@ "command": "continue.focusEdit", "group": "Continue", "when": "editorHasSelection && !editorReadonly" + }, + { + "command": "continue.writeCommentsForCode", + "group": "Continue", + "when": "editorHasSelection && !editorReadonly" + }, + { + "command": "continue.writeDocstringForCode", + "group": "Continue", + "when": "editorHasSelection && !editorReadonly" + }, + { + "command": "continue.fixCode", + "group": "Continue", + "when": "editorHasSelection && !editorReadonly" + }, + { + "command": "continue.optimizeCode", + "group": "Continue", + "when": "editorHasSelection && !editorReadonly" + }, + { + "command": "continue.fixGrammar", + "group": "Continue", + "when": "editorHasSelection && editorLangId == 'markdown' && !editorReadonly" } ], "explorer/context": [ diff --git a/extensions/vscode/src/commands.ts b/extensions/vscode/src/commands.ts index 87a7529d9..92a305012 100644 --- a/extensions/vscode/src/commands.ts +++ b/extensions/vscode/src/commands.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/naming-convention */ import * as fs from "node:fs"; -import { ILLM, ModelInstaller } from "core"; +import { ContextMenuConfig, ILLM, ModelInstaller } from "core"; import { CompletionProvider } from "core/autocomplete/CompletionProvider"; import { ConfigHandler } from "core/config/ConfigHandler"; import { EXTENSION_NAME } from "core/control-plane/env"; @@ -143,11 +143,16 @@ const getCommandsMap: ( * increments the FTC count, and then streams an edit to the * vertical diff manager. * - * @param input - The prompt to use if the configured prompt is not available. + * @param promptName - The key for the prompt in the context menu configuration. + * @param fallbackPrompt - The prompt to use if the configured prompt is not available. * @param [range] - Optional. The range to edit if provided. * @returns */ - async function streamInlineEdit(input: string, range?: vscode.Range) { + async function streamInlineEdit( + promptName: keyof ContextMenuConfig, + fallbackPrompt: string, + range?: vscode.Range, + ) { const { config } = await configHandler.loadConfig(); if (!config) { throw new Error("Config not loaded"); @@ -163,7 +168,8 @@ const getCommandsMap: ( void sidebar.webviewProtocol.request("incrementFtc", undefined); await verticalDiffManager.streamEdit({ - input, + input: + config.experimental?.contextMenuPrompts?.[promptName] ?? fallbackPrompt, llm, range, rulesToInclude: config.rules, @@ -237,7 +243,7 @@ const getCommandsMap: ( ) => { captureCommandTelemetry("customQuickActionStreamInlineEdit"); - void streamInlineEdit(prompt, range); + streamInlineEdit("docstring", prompt, range); }, "continue.codebaseForceReIndex": async () => { core.invoke("index/forceReIndex", undefined); @@ -346,7 +352,8 @@ const getCommandsMap: ( "continue.writeCommentsForCode": async () => { captureCommandTelemetry("writeCommentsForCode"); - void streamInlineEdit( + streamInlineEdit( + "comment", "Write comments for this code. Do not change anything about the code itself.", ); }, @@ -354,23 +361,26 @@ const getCommandsMap: ( captureCommandTelemetry("writeDocstringForCode"); void streamInlineEdit( + "docstring", "Write a docstring for this code. Do not change anything about the code itself.", ); }, "continue.fixCode": async () => { captureCommandTelemetry("fixCode"); - void streamInlineEdit( + streamInlineEdit( + "fix", "Fix this code. If it is already 100% correct, simply rewrite the code.", ); }, "continue.optimizeCode": async () => { captureCommandTelemetry("optimizeCode"); - void streamInlineEdit("Optimize this code"); + streamInlineEdit("optimize", "Optimize this code"); }, "continue.fixGrammar": async () => { captureCommandTelemetry("fixGrammar"); - void streamInlineEdit( + streamInlineEdit( + "fixGrammar", "If there are any grammar or spelling mistakes in this writing, fix them. Do not make other large changes to the writing.", ); }, From 1a649169a78cbd4c486830efc9352006be55f981 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Fri, 29 Aug 2025 16:56:19 +0530 Subject: [PATCH 7/7] remove the contextmenu/submenu options --- extensions/vscode/package.json | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 8054468a9..c32e9ec0e 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -183,7 +183,7 @@ { "command": "continue.focusEdit", "category": "Continue", - "title": "Edit Highlighted Code", + "title": "Add to Edit", "group": "Continue" }, { @@ -195,7 +195,7 @@ { "command": "continue.focusContinueInputWithoutClear", "category": "Continue", - "title": "Add Highlighted Code to Context", + "title": "Add to Chat", "group": "Continue" }, { @@ -547,31 +547,6 @@ "command": "continue.focusEdit", "group": "Continue", "when": "editorHasSelection && !editorReadonly" - }, - { - "command": "continue.writeCommentsForCode", - "group": "Continue", - "when": "editorHasSelection && !editorReadonly" - }, - { - "command": "continue.writeDocstringForCode", - "group": "Continue", - "when": "editorHasSelection && !editorReadonly" - }, - { - "command": "continue.fixCode", - "group": "Continue", - "when": "editorHasSelection && !editorReadonly" - }, - { - "command": "continue.optimizeCode", - "group": "Continue", - "when": "editorHasSelection && !editorReadonly" - }, - { - "command": "continue.fixGrammar", - "group": "Continue", - "when": "editorHasSelection && editorLangId == 'markdown' && !editorReadonly" } ], "explorer/context": [