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

How to do IntelliSense for snippets when some text is selected in VSCode?

$
0
0

I wrote my first snippet which would wrap the selected text in if() { selected text } block.

"if block - snippet": {
        "prefix": "if block - snippet",
        "body": [
            "if( $1 ) {",
            "$TM_SELECTED_TEXT",
            "}",
            "$0"
        ],
        "description": "if block - snippet"
    }

When I select the text and hit CTRL+SPACE it shows the intellisense but, when I start searching for my snippet "if block - snippet" instead of searching it clears-out the selected text and start writing the "if blo...." :P


One workaround is to have a dedicated keybinding to trigger snippets but I want it more implicit like in the intellisense suggestions itself. is it possible?


Viewing all articles
Browse latest Browse all 98651

Latest Images

Trending Articles



Latest Images

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