Home > database >  Add a for-loop to VSCode Snippet
Add a for-loop to VSCode Snippet

Time:05-02

I successfully created 3 VSCode snippets, I added the 4th one.

{
      "for": {
        "prefix": "for",
        "body": "for (i = 0; i < ${1:}.length; i  ) {
            console.log(${1:}[i]);
        }"
      }

  }

IDE is highlighted as red, and I am not able to see it in the snippet list.

enter image description here

How can I fix that ?

Goal is to

As I type/select for should add this code. Hint: for is my snippet prefix.

for (i = 0; i < responses.length; i  ) {
    console.log(responses[i]);
}

CodePudding user response:

I just went through the user defined enter image description here

As I select

enter image description here

  • Related