Skip to content

Commit

Permalink
Merge branch 'main' of github.com:mongodb-js/vscode into gagik/add-te…
Browse files Browse the repository at this point in the history
…lemetry-to-tree-view-buttons
  • Loading branch information
gagik committed Dec 9, 2024
2 parents e4922b2 + fabbc8c commit 5a079aa
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
11 changes: 7 additions & 4 deletions src/mdbExtensionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ import { QueryWithCopilotCodeLensProvider } from './editors/queryWithCopilotCode
import type {
SendMessageToParticipantOptions,
SendMessageToParticipantFromInputOptions,
ParticipantCommand,
} from './participant/participantTypes';
import { COPILOT_CHAT_EXTENSION_ID } from './participant/constants';
import type { ParticipantCommand } from './participant/participantTypes';
import {
COPILOT_CHAT_EXTENSION_ID,
COPILOT_EXTENSION_ID,
} from './participant/constants';
import EXTENSION_COMMANDS from './commands';

// This class is the top-level controller for our extension.
Expand Down Expand Up @@ -177,7 +180,7 @@ export default class MDBExtensionController implements vscode.Disposable {
// ------ In-app notifications ------ //
void this.showCopilotIntroductionForEstablishedUsers();

const copilot = vscode.extensions.getExtension('GitHub.copilot');
const copilot = vscode.extensions.getExtension(COPILOT_EXTENSION_ID);
void vscode.commands.executeCommand(
'setContext',
'mdb.isCopilotActive',
Expand All @@ -189,7 +192,7 @@ export default class MDBExtensionController implements vscode.Disposable {
// was activated before the Copilot one, so we check again after a delay.
if (copilot && !copilot?.isActive) {
setTimeout(() => {
const copilot = vscode.extensions.getExtension('GitHub.copilot');
const copilot = vscode.extensions.getExtension(COPILOT_EXTENSION_ID);
void vscode.commands.executeCommand(
'setContext',
'mdb.isCopilotActive',
Expand Down
11 changes: 10 additions & 1 deletion src/participant/constants.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import type * as vscode from 'vscode';
import { ChatMetadataStore } from './chatMetadata';
import type { ParticipantResponseType } from './participantTypes';

export const CHAT_PARTICIPANT_ID = 'mongodb.participant';
export const CHAT_PARTICIPANT_MODEL = 'gpt-4o';
export const COPILOT_EXTENSION_ID = 'GitHub.copilot';
export const COPILOT_CHAT_EXTENSION_ID = 'GitHub.copilot-chat';

export type ParticipantResponseType =
| 'query'
| 'schema'
| 'docs'
| 'generic'
| 'emptyRequest'
| 'cancelledRequest'
| 'askToConnect'
| 'askForNamespace';

export const codeBlockIdentifier = {
start: '```javascript',
end: '```',
Expand Down
2 changes: 1 addition & 1 deletion src/participant/prompts/exportToPlayground.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export class ExportToPlaygroundPrompt extends PromptBase<PromptArgsBase> {
return `You are a MongoDB expert.
Your task is to convert user's code written in any programming language to the MongoDB mongosh shell script.
If the user's code contains a database and collection name, preserve them in the transpiled code,
otherwise use '<YOUR_DATABASE_NAME>' and 'YOUR_COLLECTION_NAME' placeholders.
otherwise use '<YOUR_DATABASE_NAME>' and '<YOUR_COLLECTION_NAME>' placeholders.
Example:
User:
Expand Down

0 comments on commit 5a079aa

Please sign in to comment.