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

Autocomplete: Log number of accepted chars per suggestion #674

Merged
merged 2 commits into from
Aug 14, 2023

Conversation

philipp-spiess
Copy link
Contributor

@philipp-spiess philipp-spiess commented Aug 14, 2023

Part of #672

Adds tracking for number of inserted characters per completion request.

Test plan

Screenshot 2023-08-14 at 16 27 18

@philipp-spiess philipp-spiess requested review from chenkc805, abeatrix and a team August 14, 2023 14:31
@philipp-spiess philipp-spiess self-assigned this Aug 14, 2023
@philipp-spiess philipp-spiess merged commit 52eb072 into main Aug 14, 2023
8 checks passed
@philipp-spiess philipp-spiess deleted the ps/autocomplete-log-accepted-chars branch August 14, 2023 15:25
abeatrix added a commit that referenced this pull request Aug 14, 2023
…ross the extension (#675)

RE:
https://docs.google.com/document/d/1UcjUdon1XO5GoLDIJJCGBq1zyhR6VfL2FE_apSPeLQo/edit#heading=h.m8ojuhhojtjm
Close #672

Add loggings for following events

| Description | Type | Example Log Entry |

|----------------------------------------------------------------------------------|------------|-------------------------------------------------------------------------------------------|
| Chat submit from sidebar | submit | CodyVSCodeExtension:chat:submitted
{"source":"chat"} |
| Chat submit from inline | submit | CodyVSCodeExtension:chat:submitted
{"source":"inline"} |
| Chat submit from command menu | submit |
CodyVSCodeExtension:chat:submitted {"source":"menu"} |
| Code generated for chat | response |
CodyVSCodeExtension:chatResponse:noCode {} |
| Code generated for chat | response |
CodyVSCodeExtension:chatResponse:hasCode
{"lineCount":20,"charCount":575} |
| Fixup code lens button: apply | click |
CodyVSCodeExtension:fixup:codeLens:clicked', { op: apply) |
| Fixup code lens button: show diff | click |
CodyVSCodeExtension:fixup:codeLens:clicked', { op: diff) |
| Fixup code lens button: cancel | click |
CodyVSCodeExtension:fixup:codeLens:clicked', { op: cancel) |
| Fixup token count for code applied | applied |
CodyVSCodeExtension:fixup:applied {"lineCount":20,"charCount":575} |
| Chat title bar button: new convo | click |
CodyVSCodeExtension:chatTitleButton:clicked {"name":"reset"} |
| Chat title bar button: history | click |
CodyVSCodeExtension:chatTitleButton:clicked {"name":"history"} |
| Copy event on code generated for Inline Chat | keydown |
CodyVSCodeExtension:inlineChat:event:detected
{"op":"copy","lineCount":5,"charCount":76} |
| Paste event on code generated for Inline Chat | keydown |
CodyVSCodeExtension:inlineChat:event:detected
{"op":"paste","lineCount":5,"charCount":76} |
| Copy event on code generated for side bar chat triggered by copy
button click: | click | CodyVSCodeExtension:copyButton:clicked
{"lineCount":2,"charCount":27,"op":"copy"} |
| Paste event on code generated for side bar chat triggered by copy
button click: | keydown | CodyVSCodeExtension:pasteButton:clicked
{"lineCount":2,"charCount":27,"op":"paste"} |
| Copy event on code generated for side bar chat, but not triggered by
buttons | keydown | CodyVSCodeExtension:copyKeydown:clicked
{"lineCount":2,"charCount":27,"op":"copy"} |
| Paste event on code generated for side bar chat, but not triggered by
buttons | keydown | CodyVSCodeExtension:pasteKeydown:clicked
{"lineCount":2,"charCount":27,"op":"paste"} |
| Insert code block button | click |
CodyVSCodeExtension:insertButton:clicked
{“op”:“insert”,“charCount”:194,“lineCount”:11} |
| On “Stop Generating” button click in sidebar | click |
CodyVSCodeExtension:abortButton:clicked' { source: 'sidebar' } |
| On “Stop Generating” button click in Inline Chat | click |
CodyVSCodeExtension:abortButton:clicked' { source: inline } |
| Code generated for fixup task | response |
CodyVSCodeExtension:fixupResponse:hasCode
{"lineCount":12,"charCount":354} |


`CodyVSCodeExtension:completion:accepted` was added by @philipp-spiess
in #674

`CodyVSCodeExtension:completion:suggested` is not added. Will work on
this in a separated PR

## Test plan

<!-- Required. See
https://docs.sourcegraph.com/dev/background-information/testing_principles.
-->

Added test for token count methods.

To test the newly added token events

Start Cody from this branch in debug mode, and check the Output channel
for logged events after performing an action:


![image](https://github.com/sourcegraph/cody/assets/68532117/f71dc5e9-0217-43bf-be64-1a783dcae5cc)
@abeatrix abeatrix mentioned this pull request Aug 15, 2023
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.

None yet

2 participants