Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97371

VSCode: Snippet - Transform characters to another equal length line

$
0
0

What I would like: A snippet, call that Bound Line. When I trigger that snippet and type something like:

This is my line

and hit tab, it should print:

This is my line
    C
***************

'C' where the cursor should be and "****" line is exactly same number of characters as the first line. After looking over the BNF for transformations at Microsoft Documentation, I came up with the following which is horribly, horribly wrong:

"Bound Line" : {
        "prefix" : "bl",
        "body": [
            "${2:}",
            "\t$3""${2/(.*)/${1:/[a-zA-Z0-9:,;*_]/*/gi}"
        ]
    }

If you have some insights, I would appreciate it. Thanks!


Viewing all articles
Browse latest Browse all 97371

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>