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: improve the format of the participant answer VSCODE-582 #804

Conversation

alenakhineika
Copy link
Contributor

@alenakhineika alenakhineika commented Sep 3, 2024

Description

  • Use a different confirmation modal text for the Run from copilot action.
  • Remove a placeholder for a database from the copilot playground template.
  • Fix history so it contains values from markdown.

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)

@alenakhineika alenakhineika marked this pull request as ready for review September 3, 2024 16:59
@alenakhineika alenakhineika requested a review from Anemy September 3, 2024 16:59
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.

lgtm! I like that we're moving a bit more functional and keeping less things like _codeToEvaluate around on state. I find it makes things less coupled and easier to test/abstract.

@alenakhineika alenakhineika merged commit 633f1b7 into VSCODE-528-mongodb-copilot Sep 4, 2024
3 checks passed
@alenakhineika alenakhineika deleted the VSCODE-582-improve-format-of-participant-answer branch September 4, 2024 07:54
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.

A few super minor comments from me - mostly on the code, as I'm not familiar enough with the project to do a deeper review yet.


await this._openInResultPane(evaluateResponse.result);

return Promise.resolve(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] I don't believe we need the Promise.resolve here since we're already in an async context.

Suggested change
return Promise.resolve(true);
return true;

Comment on lines 690 to 694
if (
!selections ||
!Array.isArray(selections) ||
(selections.length === 1 && this._getSelectedText(selections[0]) === '')
) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this is code that didn't change in this PR, but it's counterintuitive to me that we need to do these evaluations here, considering we already have this._selectedText. I would expect that this condition is equivalent to !this._selectedText.

}

return this._evaluatePlayground();
return this._evaluatePlayground(codeToEvaluate);
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] With the current code structure, we may be passing undefined here, while _evaluatePlayground expects string. My suggestion would be to declare the type of codeToEvaluate and either return early in an else clause for the if-statement on line 690, or fallback to an empty string.

@nirinchev
Copy link
Contributor

Ugh, didn't notice the PR was merged prior to posting my comments - they're not blocking and can be addressed as a drive-by in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants