✨ configure context menu prompts
This commit is contained in:
parent
7db8f8e931
commit
ed3d4d5ed9
7 changed files with 162 additions and 5 deletions
16
core/index.d.ts
vendored
16
core/index.d.ts
vendored
|
|
@ -678,6 +678,17 @@ export interface ContinueUIConfig {
|
|||
codeBlockToolbarPosition?: "top" | "bottom";
|
||||
}
|
||||
|
||||
interface ContextMenuConfig {
|
||||
comment?: string;
|
||||
docstring?: string;
|
||||
fix?: string;
|
||||
optimize?: string;
|
||||
fixGrammar?: string;
|
||||
}
|
||||
interface ExperimantalConfig {
|
||||
contextMenuPrompts?: ContextMenuConfig;
|
||||
}
|
||||
|
||||
export interface SerializedContinueConfig {
|
||||
env?: string[];
|
||||
allowAnonymousTelemetry?: boolean;
|
||||
|
|
@ -695,6 +706,7 @@ export interface SerializedContinueConfig {
|
|||
tabAutocompleteOptions?: Partial<TabAutocompleteOptions>;
|
||||
ui?: ContinueUIConfig;
|
||||
reranker?: RerankerDescription;
|
||||
experimental?: ExperimantalConfig;
|
||||
}
|
||||
|
||||
export type ConfigMergeType = "merge" | "overwrite";
|
||||
|
|
@ -737,6 +749,8 @@ export interface Config {
|
|||
ui?: ContinueUIConfig;
|
||||
/** Options for the reranker */
|
||||
reranker?: RerankerDescription | Reranker;
|
||||
/** Experimental configuration */
|
||||
experimental?: ExperimantalConfig;
|
||||
}
|
||||
|
||||
export interface ContinueConfig {
|
||||
|
|
@ -754,6 +768,7 @@ export interface ContinueConfig {
|
|||
tabAutocompleteOptions?: Partial<TabAutocompleteOptions>;
|
||||
ui?: ContinueUIConfig;
|
||||
reranker?: Reranker;
|
||||
experimental?: ExperimantalConfig;
|
||||
}
|
||||
|
||||
export interface BrowserSerializedContinueConfig {
|
||||
|
|
@ -769,4 +784,5 @@ export interface BrowserSerializedContinueConfig {
|
|||
embeddingsProvider?: string;
|
||||
ui?: ContinueUIConfig;
|
||||
reranker?: RerankerDescription;
|
||||
experimental?: ExperimantalConfig;
|
||||
}
|
||||
|
|
|
|||
32
docs/static/schemas/config.json
vendored
32
docs/static/schemas/config.json
vendored
|
|
@ -1807,6 +1807,38 @@
|
|||
"description": "Whether to show the copy and apply code buttons at the top or bottom of code blocks in the sidebar."
|
||||
}
|
||||
}
|
||||
},
|
||||
"experimental": {
|
||||
"type": "object",
|
||||
"title": "Experimental",
|
||||
"description": "Experimental properties are subject to change.",
|
||||
"properties": {
|
||||
"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."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1807,6 +1807,38 @@
|
|||
"description": "Whether to show the copy and apply code buttons at the top or bottom of code blocks in the sidebar."
|
||||
}
|
||||
}
|
||||
},
|
||||
"experimental": {
|
||||
"type": "object",
|
||||
"title": "Experimental",
|
||||
"description": "Experimental properties are subject to change.",
|
||||
"properties": {
|
||||
"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."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1807,6 +1807,38 @@
|
|||
"description": "Whether to show the copy and apply code buttons at the top or bottom of code blocks in the sidebar."
|
||||
}
|
||||
}
|
||||
},
|
||||
"experimental": {
|
||||
"type": "object",
|
||||
"title": "Experimental",
|
||||
"description": "Experimental properties are subject to change.",
|
||||
"properties": {
|
||||
"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."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2041,6 +2041,38 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"experimental": {
|
||||
"type": "object",
|
||||
"title": "Experimental",
|
||||
"description": "Experimental properties are subject to change.",
|
||||
"properties": {
|
||||
"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."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"mergeBehavior": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
|
|
|
|||
|
|
@ -268,31 +268,39 @@ const commandsMap: (
|
|||
},
|
||||
"continue.writeCommentsForCode": async () => {
|
||||
await verticalDiffManager.streamEdit(
|
||||
"Write comments for this code. Do not change anything about the code itself.",
|
||||
(await configHandler.loadConfig()).experimental?.contextMenuPrompts
|
||||
?.comment ||
|
||||
"Write comments for this code. Do not change anything about the code itself.",
|
||||
await sidebar.webviewProtocol.request("getDefaultModelTitle", undefined),
|
||||
);
|
||||
},
|
||||
"continue.writeDocstringForCode": async () => {
|
||||
await verticalDiffManager.streamEdit(
|
||||
"Write a docstring for this code. Do not change anything about the code itself.",
|
||||
(await configHandler.loadConfig()).experimental?.contextMenuPrompts
|
||||
?.docstring ||
|
||||
"Write a docstring for this code. Do not change anything about the code itself.",
|
||||
await sidebar.webviewProtocol.request("getDefaultModelTitle", undefined),
|
||||
);
|
||||
},
|
||||
"continue.fixCode": async () => {
|
||||
await verticalDiffManager.streamEdit(
|
||||
"Fix this code",
|
||||
(await configHandler.loadConfig()).experimental?.contextMenuPrompts
|
||||
?.fix || "Fix this code",
|
||||
await sidebar.webviewProtocol.request("getDefaultModelTitle", undefined),
|
||||
);
|
||||
},
|
||||
"continue.optimizeCode": async () => {
|
||||
await verticalDiffManager.streamEdit(
|
||||
"Optimize this code",
|
||||
(await configHandler.loadConfig()).experimental?.contextMenuPrompts
|
||||
?.optimize || "Optimize this code",
|
||||
await sidebar.webviewProtocol.request("getDefaultModelTitle", undefined),
|
||||
);
|
||||
},
|
||||
"continue.fixGrammar": async () => {
|
||||
await verticalDiffManager.streamEdit(
|
||||
"If there are any grammar or spelling mistakes in this writing, fix them. Do not make other large changes to the writing.",
|
||||
(await configHandler.loadConfig()).experimental?.contextMenuPrompts
|
||||
?.fixGrammar ||
|
||||
"If there are any grammar or spelling mistakes in this writing, fix them. Do not make other large changes to the writing.",
|
||||
await sidebar.webviewProtocol.request("getDefaultModelTitle", undefined),
|
||||
);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -691,6 +691,11 @@
|
|||
resolved "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz"
|
||||
integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==
|
||||
|
||||
"@lancedb/vectordb-darwin-arm64@*":
|
||||
version "0.4.16"
|
||||
resolved "https://registry.npmjs.org/@lancedb/vectordb-darwin-arm64/-/vectordb-darwin-arm64-0.4.16.tgz"
|
||||
integrity sha512-RtuizzrZIVDYQ4ZZIMQRHGuV0DvOV93lyvivJJBLP1zCORMHEtEduaVbFE/+H0OCo0oqPsKXEpbc0nUEXKQqRg==
|
||||
|
||||
"@lancedb/vectordb-darwin-arm64@0.4.12":
|
||||
version "0.4.12"
|
||||
resolved "https://registry.npmjs.org/@lancedb/vectordb-darwin-arm64/-/vectordb-darwin-arm64-0.4.12.tgz"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue