This repository was archived by the owner on Aug 30, 2025. It is now read-only.
Fix: Stutter when completing inside string interpolations#464
Merged
Conversation
When completing certain things in string interpolations, the prefix can't be processed by the tokenizer, so `token_stream` returns the EOL from the previous line. We used the length of the EOL as the length of the prefix, which was often not enough, so we'd get a stutter when applying the text edit if the prefix was longer than 2 characters. The fix is to detect the EOL, and in that case, use Code.Fragment to parse the prefix. Fixes #462
scohen
commented
Nov 6, 2023
fd89d02 to
7d11e71
Compare
scottming
approved these changes
Nov 8, 2023
scottming
left a comment
Collaborator
There was a problem hiding this comment.
I tried this branch, works very well
zachallaun
approved these changes
Nov 8, 2023
zachallaun
left a comment
Collaborator
There was a problem hiding this comment.
Looks good and works for me locally.
7d11e71 to
225ce87
Compare
scohen
added a commit
that referenced
this pull request
Nov 8, 2023
* Fix: Stutter when completing inside string interpolations When completing certain things in string interpolations, the prefix can't be processed by the tokenizer, so `token_stream` returns the EOL from the previous line. We used the length of the EOL as the length of the prefix, which was often not enough, so we'd get a stutter when applying the text edit if the prefix was longer than 2 characters. The fix is to detect the EOL, and in that case, use Code.Fragment to parse the prefix. Fixes #462
scohen
added a commit
that referenced
this pull request
Nov 9, 2023
…)" This reverts commit c73b0d0.
scohen
added a commit
that referenced
this pull request
Nov 9, 2023
…)" This reverts commit c73b0d0.
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
When completing certain things in string interpolations, the prefix can't be processed by the tokenizer, so
token_streamreturns the EOL from the previous line. We used the length of the EOL as the length of the prefix, which was often not enough, so we'd get a stutter when applying the text edit if the prefix was longer than 2 characters.The fix is to detect the EOL, and in that case, use Code.Fragment to parse the prefix.
Fixes #462