question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bugs with `template-string-converter.autoRemoveTemplateString`

See original GitHub issue

First 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:

  1. Adding a variable with an empty template string (for editing afterwards) causes it to be transformed to double quotes right away.

    Kapture 2021-04-02 at 12 40 30

    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:

    Kapture 2021-04-02 at 12 43 46

  2. Removing the interpolation from a template string causes the cursor to jump to the end:

    Kapture 2021-04-02 at 12 52 29

  3. Typing inside an existing template string causes it to be converted to a string. This is exacerbated by 2 above.

    Kapture 2021-04-02 at 12 47 18

    This also is triggered by typing a $ into an empty template string:

    Kapture 2021-04-02 at 12 50 57

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:closed
  • Created 2 years ago
  • Comments:41 (31 by maintainers)

github_iconTop GitHub Comments

1reaction
karlhorkycommented, Jan 15, 2022

@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:

  1. The next time that the buggy behavior happens for you, backtrack a bit (undo a few times until before the bug), and then perform the exact actions needed to make it happen again
  2. Copy the code you think was causing it into a new file and try it again elsewhere, to verify that the bug is really associated with the code you suspect it is. If the buggy behavior didn’t show up, you can instead copy more of your code again into a new file, and repeat until you find the correct code that causes the buggy behavior.
  3. Once you find the code and the set of actions that triggers the buggy behavior, then you can copy the code into a new issue in this repository, along with a detailed description of the actions that someone else would follow to trigger the buggy behavior. At this point, you could also consider taking a video to post along with the new issue (I recommend Kap on macOS and ScreenToGif on Windows)

This is also what I went through to report the other issues in this repo.

1reaction
karlhorkycommented, Dec 29, 2021

This template-string-converter.autoRemoveTemplateString feature looks pretty good now, great work @meganrogge ! 🙌

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bugs : Got Pests? : Board of Pesticides Control - Maine.gov
Armyworms Bees, Hornets and Wasps Boxelder Bug Cabbage Maggot Carpet Beetles Clover Mite Colorado Potato Beetle Earwig European Fire Ants Flea Beetles Fruit...
Read more >
Triatomine Bug FAQs - Chagas Disease - CDC
Triatomine bugs (also called “kissing bugs”, cone-nosed bugs, and blood suckers) can live indoors, in cracks and holes of substandard housing, or in...
Read more >
Bed Bugs: Get Them Out and Keep Them Out | US EPA
Prevent, identify, and treat bed bug infestations using EPA's step-by-step guides, based on IPM principles. Find pesticides approved for bed ...
Read more >
Bed Bugs - What They Are and How to Control Them
They feed on blood, but are not known to spread any diseases to humans. Some people can be allergic to their bites. Getting...
Read more >
Fun Facts About Bugs | Smithsonian Institution
Tiger Moth Golden Ground Beetle Leafwing Butterfly Sweetheart Underwing Bumble Bee, Bumblebee Elephant Beetle Wood Ant Frog-legged Leaf Beetle Atlas Beetle Stink Bug...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found