Merged
Conversation
aswamy
approved these changes
Mar 30, 2026
Contributor
aswamy
left a comment
There was a problem hiding this comment.
Great stuff! Tophatted with 0, 1, and 2+ tabstops and everything works as expected. One small suggestion.
EvilGenius13
approved these changes
Mar 30, 2026
451ab99 to
f15566c
Compare
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 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.
What are you adding in this PR?
This fix adds tabstops to all the translation completions-- after selecting the autocomplete label from the dropdown, and pressing
tab, the editor will now highlight the variable text to be filled by the user and the user will be able to type directly into this space, thentabforward and write text over the next variable (if there are multiple variables).This will only work for translations that have variables.
I wrote a new function in
translations.tsthat creates the string with the Snippet syntax. There are Plain Text strings and Snippet strings, the previously used function returned PlainText and the tabstops behavior is only available on a Snippet.The function gets called in the TranslationCompletionProvider and the insertTextFormat flag also gets set to Snippet now, so the editor knows to interpret the string as Snippet and surface the tabstops behavior to the user.
The existing spec file passes with my change and I added a new test to verify the new behavior
Fixes #537
How to Tophat
Off of main (old behavior): To trigger the translation key autocomplete with variables, go to any .liquid file and type:
{{ 'search.resand pause for autocomplete to pop up. Select
search.results_for_htmland accept it, then notice that the variables are not highlighted and must be selected manually to be typed over (screenshots are in the linked ticket)To see the new behavior, pull down my branch, function F5 to open the Extension Development instance in any theme and repeat the process. Now you should see the variables highlighted, with the ability to tab to each one and type over.
Here is a screen recording of the correct, tophatted behavior:
Screen.Recording.2026-03-24.at.1.54.33.PM.mov
What did you learn?
I learned about the block element █ .
in the context of the tests in the spec file, the block element is used by the test framework to mock the cursor position so the test knows when to trigger the autocomplete functionality and must be used when testing autocomplete behavior (which my change falls under) but isn't needed to test things like the dropdown labels being present or the documentation pop-up.
Before you deploy
changeset