Bugs with `template-string-converter.autoRemoveTemplateString`
See original GitHub issueFirst of all, thanks @meganrogge for your continued work on this extension, and @xNocken for creating the feature to convert back to a regular string when the interpolation markers (${}
) are removed (in #19, original issue: #16).
The new feature is unfortunately somewhat buggy, making the editor actually frustratingly unusable in some cases.
Here are some buggy cases:
-
Adding a variable with an empty template string (for editing afterwards) causes it to be transformed to double quotes right away.
This particular issue above is avoided by only pressing the backtick key on the keyboard once, but this workaround doesn’t work with tagged template literals:
-
Removing the interpolation from a template string causes the cursor to jump to the end:
-
Typing inside an existing template string causes it to be converted to a string. This is exacerbated by 2 above.
This also is triggered by typing a
$
into an empty template string:
I seem to have the feeling there were more problems with it, but I can’t think of them right now. I’ll follow up later with them if they come up.
It seems like some of these things may be solved by running this on file save. Hmmm… maybe also for the whole extension? @meganrogge what are your thoughts about running the transformations from this extension generally always on save? (eg. allowing configuration under editor.codeActionsOnSave
?). This would also address cases like https://github.com/meganrogge/template-string-converter/issues/38
Or, if not, then maybe making it so that these autoRemoveTemplateString
transformations get applied on save.
Issue Analytics
- State:
- Created 2 years ago
- Comments:41 (31 by maintainers)
Top GitHub Comments
@xNocken to create a good, reproducible example, it can help to start with code.
If you want to put effort into creating a new issue that will capture the problem so that the bug gets fixed, try this:
This is also what I went through to report the other issues in this repo.
This
template-string-converter.autoRemoveTemplateString
feature looks pretty good now, great work @meganrogge ! 🙌