-
Notifications
You must be signed in to change notification settings - Fork 268
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: Add alt+\ shortcut to trigger autocomplete and bypass debouncing times #1060
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this! Needed this!
Have a question about how this helps with speed as mentioned in the changelog (still trying to understand how everything works together
@@ -22,6 +22,8 @@ Starting from `0.2.0`, Cody is using `major.EVEN_NUMBER.patch` for release versi | |||
- Enabled streaming responses for all autocomplete requests. [pull/995](https://github.com/sourcegraph/cody/pull/995) | |||
- Sign out immediately instead of showing the quick-pick menu. [pull/1032](https://github.com/sourcegraph/cody/pull/1032) | |||
- UX improvements to the custom command workflow (and new [custom command docs](https://docs.sourcegraph.com/cody/custom-commands)). [pull/992](https://github.com/sourcegraph/cody/pull/992) | |||
- You can now use `alt` + `\` to trigger autocomplete requests manually. [pull/1060](https://github.com/sourcegraph/cody/pull/1060) | |||
- Slightly reduce latency when manually triggering autocomplete requests. [pull/1060](https://github.com/sourcegraph/cody/pull/1060) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate more on how this change reduces latency, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is related to this code change: https://github.com/sourcegraph/cody/pull/1060/files#diff-0bf82c65c27367a15630425d194c46f5a66bae138f46c63361027b00161c1720R208-R212
Previously, manually triggered completions (so either using the new shortcut or by hovering over a completed text to see all possible results) would still have waited for the small 25ms/125ms debounce time - That time is so that we don't trigger toooo many network requests while typing to save some money. However for manually invoked completions we don't need that because they are already very low in volume + they are a strong sign that you want a completion NOW.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abeatrix let me know if this makes sense 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does! Thank you!
@philipp-spiess Should this bypass other restrictions too? We don't produce completions here as we've discussed before, but if I forcibly request it - that might be useful? Unsure if there's a way to pick up on how the completion was triggered |
Closes #1019
This adds the manual completion shortcut to trigger completions.
This change also disables the debounce timings when the completion was manually requested (that is, either using this shortcut or when hovering over completions). This is done to slightly increase latency when we already have a strong sign that the user really wants that completion
Test plan
Screen.Recording.2023-09-14.at.15.20.11.mov