From 44ca4b1ffc11f7ec813aa0140040b00248dfc24f Mon Sep 17 00:00:00 2001 From: Srikanth Srungarapu Date: Thu, 25 Jan 2024 16:32:57 +0530 Subject: [PATCH] feat: added a shortcut for opening extension settings on the top right of sidebar --- README.md | 2 +- app/vscode/asset/package.json | 25 +++++++++++++------------ lib/extension/src/extension.ts | 14 ++++++-------- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 3b2d81f..a984eb2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

💬 Privy

- A privacy-first coding assistant. + A privacy based alternative to GitHub co-pilot.

License: MIT Twitter: @getprivydev diff --git a/app/vscode/asset/package.json b/app/vscode/asset/package.json index d1bbb6b..3c2eeab 100644 --- a/app/vscode/asset/package.json +++ b/app/vscode/asset/package.json @@ -2,7 +2,7 @@ "publisher": "Privy", "name": "privy-vscode", "version": "0.1.5", - "displayName": "Privy - Your private coding assistant", + "displayName": "Privy - A privacy based alternative to GitHub co-pilot. ", "description": "Chat with code, explain code, generate tests, find bugs, etc.", "keywords": [ "ai", @@ -46,16 +46,6 @@ ], "contributes": { "commands": [ - { - "command": "privy.enterOpenAIApiKey", - "category": "Privy", - "title": "Enter OpenAI API key" - }, - { - "command": "privy.clearOpenAIApiKey", - "category": "Privy", - "title": "Clear OpenAI API key" - }, { "command": "privy.startChat", "title": "Start Chat 💬", @@ -121,6 +111,12 @@ "category": "Privy", "icon": "$(question)" }, + { + "command": "privy.openSettings", + "title": "Open Settings", + "category": "Privy", + "icon": "$(settings)" + }, { "command": "privy.reloadTemplates", "title": "Reload Templates", @@ -312,9 +308,14 @@ "group": "navigation@1" }, { - "command": "privy.getStarted", + "command": "privy.openSettings", "when": "view == privy.chat", "group": "navigation@2" + }, + { + "command": "privy.getStarted", + "when": "view == privy.chat", + "group": "navigation@3" } ], "touchBar": [ diff --git a/lib/extension/src/extension.ts b/lib/extension/src/extension.ts index 61b8269..78ce159 100644 --- a/lib/extension/src/extension.ts +++ b/lib/extension/src/extension.ts @@ -66,14 +66,6 @@ export const activate = async (context: vscode.ExtensionContext) => { context.subscriptions.push( vscode.window.registerWebviewViewProvider("privy.chat", chatPanel), - vscode.commands.registerCommand( - "privy.enterOpenAIApiKey", - apiKeyManager.enterOpenAIApiKey.bind(apiKeyManager) - ), - vscode.commands.registerCommand("privy.clearOpenAIApiKey", async () => { - await apiKeyManager.clearOpenAIApiKey(); - vscode.window.showInformationMessage("OpenAI API key cleared."); - }), vscode.commands.registerCommand("privy.startConversation", (templateId) => chatController.createConversation(templateId) @@ -139,6 +131,12 @@ export const activate = async (context: vscode.ExtensionContext) => { category: `Privy.privy-vscode#privy`, }); }), + vscode.commands.registerCommand("privy.openSettings", async () => { + await vscode.commands.executeCommand( + "workbench.action.openSettings", + `@ext:privy.privy-vscode` + ); + }), vscode.commands.registerCommand("privy.reloadTemplates", async () => { await conversationTypesProvider.loadConversationTypes(); vscode.window.showInformationMessage("Privy templates reloaded.");