-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Track cursor offset before bias in Supermaven completion provider #18858
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cla-bot
bot
added
the
cla-signed
The user has signed the Contributor License Agreement
label
Oct 8, 2024
SomeoneToIgnore
approved these changes
Oct 10, 2024
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.
Tested and it looks much better with backspacing and removal indeed, thank you!
SomeoneToIgnore
pushed a commit
that referenced
this pull request
Oct 14, 2024
Closes #19051 Closes #19182 #### How to reproduce this crash: 1. Open any file and input some ASCII characters. 2. Replace these characters with `你好`. 3. Press `backspace`. 4. Crash. https://github.com/user-attachments/assets/ea5c5340-29a5-42c8-98c5-6e60770445a4 The issue lies with the `prefix_offset` introduced in #18858. After the buffer is modified, this value is not always valid and may fall within a `char boundary`, which results in a crash. Release Notes: - Fixed Supermaven crashing on deleting non-ASCII text
noaccOS
pushed a commit
to noaccOS/zed
that referenced
this pull request
Oct 19, 2024
…d-industries#18858) Track the cursor offset before biasing in the Supermaven completion provider to better determine if the text should be suggested. The underlying issue here is due to the way anchor biasing works, the completion provider is not able to determine if a given suggestion's cursor location no longer exists as it is always coalesced to a correct location (specifically, the end of the line). This change updates that logic so the offset is stored independently of the buffer so it can be used to represent a location that may not exist in the buffer anymore to represent locations that have been deleted. The net effect is that suggestions can be backspaced much more cleanly with Supermaven. ![image](https://github.com/user-attachments/assets/ff61aa09-54ea-4cad-b1ca-633a08bcdd96) ![image](https://github.com/user-attachments/assets/b49e2d6b-f1d3-41a1-9b75-c4bc3ac5f85b) Release Notes: - Improves zed-industries#17981 to prevent suggesting completions based on out-of-date cursor locations.
noaccOS
pushed a commit
to noaccOS/zed
that referenced
this pull request
Oct 19, 2024
Closes zed-industries#19051 Closes zed-industries#19182 #### How to reproduce this crash: 1. Open any file and input some ASCII characters. 2. Replace these characters with `你好`. 3. Press `backspace`. 4. Crash. https://github.com/user-attachments/assets/ea5c5340-29a5-42c8-98c5-6e60770445a4 The issue lies with the `prefix_offset` introduced in zed-industries#18858. After the buffer is modified, this value is not always valid and may fall within a `char boundary`, which results in a crash. Release Notes: - Fixed Supermaven crashing on deleting non-ASCII text
thank you for this fix!! i just read the changelog & realized THIS was what made supermaven so annoying and error-prone to me. helps a lot! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Track the cursor offset before biasing in the Supermaven completion provider to better determine if the text should be suggested. The underlying issue here is due to the way anchor biasing works, the completion provider is not able to determine if a given suggestion's cursor location no longer exists as it is always coalesced to a correct location (specifically, the end of the line).
This change updates that logic so the offset is stored independently of the buffer so it can be used to represent a location that may not exist in the buffer anymore to represent locations that have been deleted.
The net effect is that suggestions can be backspaced much more cleanly with Supermaven.
Release Notes: