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] 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.", ); },