Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(participant): export to a playground VSCODE-574 #832

Merged
merged 16 commits into from
Oct 24, 2024

Conversation

alenakhineika
Copy link
Contributor

@alenakhineika alenakhineika commented Sep 24, 2024

Description

Convert the full text from the active editor or selected lines of code written in the input language to the Shell language and open a new MongoDB playground with the generated code.

Checklist

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

Copy link
Member

@Anemy Anemy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, left a couple comments mostly on prompt suggestions. Stoked to give this a try.

src/test/suite/participant/participant.test.ts Outdated Show resolved Hide resolved
src/participant/prompts/exportToPlayground.ts Outdated Show resolved Hide resolved
src/participant/prompts/exportToPlayground.ts Outdated Show resolved Hide resolved
src/participant/prompts/exportToPlayground.ts Outdated Show resolved Hide resolved
src/participant/prompts/exportToPlayground.ts Outdated Show resolved Hide resolved
src/participant/participant.ts Outdated Show resolved Hide resolved
@alenakhineika alenakhineika marked this pull request as ready for review September 24, 2024 16:09
Copy link
Member

@Anemy Anemy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, a couple small nit comments and one on our promise usage and error handling.

src/test/suite/suggestTestHelpers.ts Show resolved Hide resolved
src/participant/prompts/exportToPlayground.ts Outdated Show resolved Hide resolved
src/editors/playgroundController.ts Outdated Show resolved Hide resolved
src/editors/playgroundController.ts Outdated Show resolved Hide resolved
src/participant/participant.ts Outdated Show resolved Hide resolved
src/participant/participant.ts Outdated Show resolved Hide resolved
src/editors/playgroundController.ts Outdated Show resolved Hide resolved
src/participant/prompts/exportToPlayground.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@nirinchev nirinchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done - I mostly have minor comments/suggestions.

package.json Outdated Show resolved Hide resolved
src/editors/playgroundController.ts Outdated Show resolved Hide resolved
Comment on lines +1236 to +1241
token,
}),
new Promise<undefined>((resolve) =>
token.onCancellationRequested(() => {
resolve(undefined);
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're already passing the cancellation token to getChatResponseContent - why do we need the extra promise here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem that the token passed to the await model.sendRequest(messages, {}, token) terminates the request to the model and the model returns a result anyway. I want to investigate this more separately and maybe file the ticket to vscode.

src/participant/participant.ts Outdated Show resolved Hide resolved
src/participant/participant.ts Outdated Show resolved Hide resolved
src/participant/participant.ts Outdated Show resolved Hide resolved
src/participant/prompts/exportToPlayground.ts Outdated Show resolved Hide resolved
src/participant/prompts/exportToPlayground.ts Outdated Show resolved Hide resolved
Copy link
Member

@Anemy Anemy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left two suggestions/questions, not blockers. lgtm! Haven't tried it out much yet

src/participant/participant.ts Outdated Show resolved Hide resolved
src/editors/playgroundController.ts Outdated Show resolved Hide resolved
…SCODE-574-export-to-playground

# Conflicts:
#	src/participant/participant.ts
#	src/test/suite/participant/participant.test.ts
Base automatically changed from VSCODE-528-mongodb-copilot to main September 30, 2024 15:23
…playground

# Conflicts:
#	src/editors/playgroundController.ts
#	src/participant/participant.ts
#	src/participant/prompts/schema.ts
#	src/telemetry/telemetryService.ts
#	src/test/suite/editors/playgroundController.test.ts
#	src/test/suite/participant/participant.test.ts
#	src/test/suite/telemetry/telemetryService.test.ts
…playground

# Conflicts:
#	src/participant/prompts/index.ts
@alenakhineika alenakhineika merged commit 62a7897 into main Oct 24, 2024
5 checks passed
@alenakhineika alenakhineika deleted the VSCODE-574-export-to-playground branch October 24, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants