Skip to content

Conversation

@zixlin7
Copy link
Contributor

@zixlin7 zixlin7 commented Oct 23, 2024

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

users will be able to chat with Q in editor by using command/ctrl + I to bring up chat popup, get code diff in editor and accept/reject diff

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • I have added metrics for my changes (if required)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

@zixlin7 zixlin7 marked this pull request as draft October 24, 2024 18:16
@zixlin7 zixlin7 marked this pull request as ready for review October 25, 2024 18:56
@rli
Copy link
Contributor

rli commented Oct 28, 2024

is there tracking item for tests

@zixlin7
Copy link
Contributor Author

zixlin7 commented Oct 28, 2024

is there tracking item for tests

Will and a SIM to track the tests

@zixlin7 zixlin7 requested a review from rli October 28, 2024 22:16
Comment on lines +119 to +126
private val popupSubmitHandler: suspend (String, String, Int, Editor) -> String = {
prompt: String, selectedCode: String, selectedLineStart: Int, editor: Editor ->
runBlocking {
isInProgress.set(true)
val message = handleChat(prompt, selectedCode, editor, selectedLineStart)
message
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
private val popupSubmitHandler: suspend (String, String, Int, Editor) -> String = {
prompt: String, selectedCode: String, selectedLineStart: Int, editor: Editor ->
runBlocking {
isInProgress.set(true)
val message = handleChat(prompt, selectedCode, editor, selectedLineStart)
message
}
}
private val popupSubmitHandler: suspend (String, String, Int, Editor) -> String = {
prompt, selectedCode, selectedLineStart, editor ->
isInProgress.set(true)
val message = handleChat(prompt, selectedCode, editor, selectedLineStart)
message
}

or

Suggested change
private val popupSubmitHandler: suspend (String, String, Int, Editor) -> String = {
prompt: String, selectedCode: String, selectedLineStart: Int, editor: Editor ->
runBlocking {
isInProgress.set(true)
val message = handleChat(prompt, selectedCode, editor, selectedLineStart)
message
}
}
private suspend fun popupSubmitHandler(prompt: String, selectedCode: String, selectedLineStart: Int, editor: Editor): String {
isInProgress.set(true)
val message = handleChat(prompt, selectedCode, editor, selectedLineStart)
return message
}

and then you should be able to do

InlineChatPopupFactory(
            submitHandler = ::popupSubmitHandler,
        )

Copy link
Contributor

@rli rli left a comment

Choose a reason for hiding this comment

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

no major comments remaining

@zixlin7 zixlin7 merged commit 4eb2943 into aws:main Oct 28, 2024
12 of 13 checks passed
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.

4 participants