Search code examples
visual-studio-codecode-snippetsusability

In Visual Code (mac) is there a way to start at the second placeholder on a snippet?


I love to use snippets in the form of:

println("MyVariable:" + MyVariable);

So I end up creating snippets like this:

SnippetBody:[ "printlns(\"$1:\" + $1);" ]

The problem is that I want the focus on the second $1 so the intellisense triggers. Since the focus is on the first $1 and it's a string, then there is no intellisense.

Thanks!


Solution

  • If all you want is for autocomplete to work on strings, you can look at the settings and set:

    "editor.quickSuggestions": {
            "other": true,
            "comments": false,
            "strings": true
        }
    

    Then you start typing and use CtrlSpace to trigger the list.