diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-07-26 09:20:56 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-07-26 09:20:56 -0700 |
commit | 4c84e6945a7c2018622eceb54e7fb54de193b03a (patch) | |
tree | aff2868636c87a814d0d7a3c078247fd0e58061d | |
parent | 7534f361555ebf92690d58d997915c7ac717f5d1 (diff) | |
download | sncontinue-4c84e6945a7c2018622eceb54e7fb54de193b03a.tar.gz sncontinue-4c84e6945a7c2018622eceb54e7fb54de193b03a.tar.bz2 sncontinue-4c84e6945a7c2018622eceb54e7fb54de193b03a.zip |
fix: :bug: fix dialog links
-rw-r--r-- | extension/package.json | 5 | ||||
-rw-r--r-- | extension/react-app/src/components/TextDialog.tsx | 37 | ||||
-rw-r--r-- | extension/src/debugPanel.ts | 1 | ||||
-rw-r--r-- | extension/src/diffs.ts | 56 |
4 files changed, 62 insertions, 37 deletions
diff --git a/extension/package.json b/extension/package.json index 00a7b54c..9c89d22d 100644 --- a/extension/package.json +++ b/extension/package.json @@ -53,11 +53,6 @@ "type": "string", "default": null, "description": "The OpenAI API key to use for code generation." - }, - "continue.dataSwitch": { - "type": "boolean", - "default": false, - "description": "If true, collect data on accepted and rejected suggestions." } } }, diff --git a/extension/react-app/src/components/TextDialog.tsx b/extension/react-app/src/components/TextDialog.tsx index 7d8e9920..43051a04 100644 --- a/extension/react-app/src/components/TextDialog.tsx +++ b/extension/react-app/src/components/TextDialog.tsx @@ -81,7 +81,42 @@ const TextDialog = (props: { }} > <Dialog> - <ReactMarkdown>{props.message || ""}</ReactMarkdown> + {props.message?.includes("Continue uses GPT-4") ? ( + <div> + <p> + Continue uses GPT-4 by default, but works with any model. If + you'd like to keep your code completely private, there are few + options: + </p> + + <p> + Run a local model with ggml:{" "} + <a + href="https://github.com/continuedev/ggml-server-example" + target="_blank" + > + 5 minute quickstart + </a> + </p> + + <p> + Use Azure OpenAI service, which is GDPR and HIPAA compliant: + <a + href="https://continue.dev/docs/customization#azure-openai-service" + target="_blank" + > + Tutorial + </a> + </p> + + <p> + If you already have an LLM deployed on your own infrastructure, + or would like to do so, please contact us at hi@continue.dev. + </p> + </div> + ) : ( + <ReactMarkdown>{props.message || ""}</ReactMarkdown> + )} {props.entryOn && ( <> <TextArea diff --git a/extension/src/debugPanel.ts b/extension/src/debugPanel.ts index 6dcb588a..ece362f5 100644 --- a/extension/src/debugPanel.ts +++ b/extension/src/debugPanel.ts @@ -95,6 +95,7 @@ export function setupDebugPanel( panel.webview.options = { enableScripts: true, localResourceRoots: [vscode.Uri.joinPath(extensionUri, "react-app/dist")], + enableCommandUris: true, }; const nonce = getNonce(); diff --git a/extension/src/diffs.ts b/extension/src/diffs.ts index 1130a06a..efaf7626 100644 --- a/extension/src/diffs.ts +++ b/extension/src/diffs.ts @@ -273,40 +273,34 @@ class DiffManager { export const diffManager = new DiffManager(); function recordAcceptReject(accepted: boolean, diffInfo: DiffInfo) { - const collectOn = vscode.workspace - .getConfiguration("continue") - .get<boolean>("dataSwitch"); + const devDataDir = devDataPath(); + const suggestionsPath = path.join(devDataDir, "suggestions.json"); - if (collectOn) { - const devDataDir = devDataPath(); - const suggestionsPath = path.join(devDataDir, "suggestions.json"); + // Initialize suggestions list + let suggestions = []; - // Initialize suggestions list - let suggestions = []; - - // Check if suggestions.json exists - if (fs.existsSync(suggestionsPath)) { - const rawData = fs.readFileSync(suggestionsPath, "utf-8"); - suggestions = JSON.parse(rawData); - } - - // Add the new suggestion to the list - suggestions.push({ - accepted, - timestamp: Date.now(), - suggestion: diffInfo.originalFilepath, - }); - - // Send the suggestion to the server - // ideProtocolClient.sendAcceptRejectSuggestion(accepted); - - // Write the updated suggestions back to the file - fs.writeFileSync( - suggestionsPath, - JSON.stringify(suggestions, null, 4), - "utf-8" - ); + // Check if suggestions.json exists + if (fs.existsSync(suggestionsPath)) { + const rawData = fs.readFileSync(suggestionsPath, "utf-8"); + suggestions = JSON.parse(rawData); } + + // Add the new suggestion to the list + suggestions.push({ + accepted, + timestamp: Date.now(), + suggestion: diffInfo.originalFilepath, + }); + + // Send the suggestion to the server + // ideProtocolClient.sendAcceptRejectSuggestion(accepted); + + // Write the updated suggestions back to the file + fs.writeFileSync( + suggestionsPath, + JSON.stringify(suggestions, null, 4), + "utf-8" + ); } export async function acceptDiffCommand(newFilepath?: string) { |