Skip to content

Conversation

@laileni-aws
Copy link
Contributor

Types of changes

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

Description

  • The Q chat telemetry event recordAddMessage is missing the required parameter cwsprChatResponseCodeSnippetCount for AB testing.
  • Solution: Counting the three back ticks(```) to find out total number of code blocks in the generated message response.
  • Added cwsprChatCodeBlockIndex and cwsprChatTotalCodeBlocks parameters to the onCopyCodeToClipboard and onCodeInsertToCursorPosition events.
  • cwsprChatCodeBlockIndex - Provides the index of that code block, when a user interacts with a code block within a message in the conversation,
  • cwsprChatTotalCodeBlocks - Total number of code blocks inside a generated message.
  • Passed these two parameters to insert_code_at_cursor_position and code_was_copied_to_clipboard telemetry events.

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.

@laileni-aws laileni-aws marked this pull request as ready for review April 20, 2024 23:20
@laileni-aws laileni-aws requested review from a team as code owners April 20, 2024 23:20
if (message.isEmpty()) {
return 0
}
val countOfCodeBlocks = Regex("^```", RegexOption.MULTILINE).findAll(message)
Copy link
Contributor

Choose a reason for hiding this comment

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

static regex should only be created once

@laileni-aws laileni-aws requested review from dogusata and rli April 22, 2024 18:36
@sonarqubecloud
Copy link

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

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