Skip to content

Commit

Permalink
fix: fixing cold start issues and disabling poorly designed edit func…
Browse files Browse the repository at this point in the history
…tionality
  • Loading branch information
srikanth235 committed Feb 2, 2024
1 parent 3c42aae commit 3abfcd0
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 44 deletions.
40 changes: 2 additions & 38 deletions app/vscode/asset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@
"category": "Privy",
"icon": "$(comment-discussion)"
},
{
"command": "privy.editCode",
"title": "Edit Code 🖊️",
"category": "Privy",
"icon": "$(edit)"
},
{
"command": "privy.explainCode",
"title": "Explain Code 💬",
Expand All @@ -82,22 +76,16 @@
},
{
"command": "privy.diagnoseErrors",
"title": "Diagnose Errors 💬",
"title": "Diagnose Errors",
"category": "Privy",
"icon": "$(search-fuzzy)"
},
{
"command": "privy.findBugs",
"title": "Find Bugs 💬",
"title": "Find Bugs",
"category": "Privy",
"icon": "$(bug)"
},
{
"command": "privy.startCustomChat",
"title": "Start Custom Chat… 💬",
"category": "Privy",
"icon": "$(comment-draft)"
},
{
"command": "privy.touchBar.startChat",
"category": "Privy",
Expand Down Expand Up @@ -240,13 +228,6 @@
"scope": "application",
"order": 10
},
"privy.action.editCode.showInEditorContextMenu": {
"type": "boolean",
"default": true,
"markdownDescription": "Show this action in the editor context menu, when you right-click on the code.",
"scope": "application",
"order": 11
},
"privy.action.startChat.showInEditorContextMenu": {
"type": "boolean",
"default": true,
Expand Down Expand Up @@ -281,13 +262,6 @@
"markdownDescription": "Show this action in the editor context menu, when you right-click on the code.",
"scope": "application",
"order": 17
},
"privy.action.startCustomChat.showInEditorContextMenu": {
"type": "boolean",
"default": true,
"markdownDescription": "Show this action in the editor context menu, when you right-click on the code.",
"scope": "application",
"order": 17
}
}
},
Expand All @@ -302,16 +276,6 @@
"when": "!isMac",
"key": "Ctrl+Alt+c"
},
{
"command": "privy.editCode",
"when": "isMac",
"key": "Ctrl+Cmd+e"
},
{
"command": "privy.editCode",
"when": "!isMac",
"key": "Ctrl+Alt+e"
},
{
"command": "privy.generateCode",
"when": "isMac",
Expand Down
11 changes: 7 additions & 4 deletions lib/extension/src/chat/ChatPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ import * as vscode from "vscode";
import { ApiKeyManager } from "../ai/ApiKeyManager";
import { WebviewContainer } from "../webview/WebviewContainer";
import { ChatModel } from "./ChatModel";
import { Logger } from "../logger";

function getConfigSurfacePromptForOpenAIPlus(): boolean {
return vscode.workspace
.getConfiguration("privy.openAI")
.get<boolean>("surfacePromptForPlus", false);
return false;
}

export class ChatPanel implements vscode.WebviewViewProvider {
Expand All @@ -25,17 +24,21 @@ export class ChatPanel implements vscode.WebviewViewProvider {
private apiKeyManager: ApiKeyManager;

private state: webviewApi.PanelState;
private readonly logger: Logger;

constructor({
extensionUri,
apiKeyManager,
hasOpenAIApiKey,
logger,
}: {
readonly extensionUri: vscode.Uri;
apiKeyManager: ApiKeyManager;
/** Needed since retrieving it is an async operation */
hasOpenAIApiKey: boolean;
logger: Logger;
}) {
this.logger = logger;
this.extensionUri = extensionUri;
this.apiKeyManager = apiKeyManager;

Expand Down Expand Up @@ -107,7 +110,7 @@ export class ChatPanel implements vscode.WebviewViewProvider {
}

const surfacePromptForOpenAIPlus = getConfigSurfacePromptForOpenAIPlus();
const hasOpenAIApiKey = await this.apiKeyManager.hasOpenAIApiKey();
const hasOpenAIApiKey = false;
this.state = {
type: "chat",
selectedConversationId: model.selectedConversationId,
Expand Down
1 change: 1 addition & 0 deletions lib/extension/src/conversation/ConversationType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export class ConversationType {
diffEditorManager: DiffEditorManager;
logger: Logger;
}): Promise<CreateConversationResult> {
logger.debug(`creating conversation ${this.id}:${conversationId}`);
return {
type: "success",
conversation: new Conversation({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as vscode from "vscode";
import { loadConversationFromFile } from "./loadRubberduckTemplateFromFile";
import { RubberduckTemplateLoadResult } from "./RubberduckTemplateLoadResult";

const TEMPLATE_GLOB = ".rubberduck/template/**/*.rdt.md";
const TEMPLATE_GLOB = ".privy/template/**/*.rdt.md";

export async function loadRubberduckTemplatesFromWorkspace(): Promise<
Array<RubberduckTemplateLoadResult>
Expand Down
1 change: 1 addition & 0 deletions lib/extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const activate = async (context: vscode.ExtensionContext) => {
extensionUri: context.extensionUri,
apiKeyManager,
hasOpenAIApiKey,
logger: vscodeLogger,
});

const chatModel = new ChatModel();
Expand Down
1 change: 0 additions & 1 deletion template/task/generate-unit-test.rdt.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ The programming language is {{language}}.
## Response
```

### Response Prompt
Expand Down

0 comments on commit 3abfcd0

Please sign in to comment.