remove contextmenuprompts experimental config

- also remove json reference docs
This commit is contained in:
uinstinct 2025-08-26 17:14:40 +05:30
parent fb6a80433c
commit 469d29dc0e
5 changed files with 9 additions and 53 deletions

View file

@ -1104,7 +1104,6 @@ declare global {
};
interface ExperimentalConfig {
contextMenuPrompts?: ContextMenuConfig;
modelRoles?: ExperimentalModelRoles;
defaultContext?: DefaultContextProvider[];
promptPath?: string;

1
core/index.d.ts vendored
View file

@ -1532,7 +1532,6 @@ export type DefaultContextProvider = ContextProviderWithParams & {
};
export interface ExperimentalConfig {
contextMenuPrompts?: ContextMenuConfig;
modelRoles?: ExperimentalModelRoles;
defaultContext?: DefaultContextProvider[];
promptPath?: string;

View file

@ -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

View file

@ -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`.",

View file

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