Visual Studio Code user snippets not working

后端 未结 18 2295
遥遥无期
遥遥无期 2021-02-01 02:13

I\'ve enabled the default \"log\" snippet in VS Code. I also added another snippet. Neither show up when I type their prefixes. I have set editor.tabCompletion to t

18条回答
  •  不要未来只要你来
    2021-02-01 03:09

    In my case it was not working because I had a space in the name of the snippet

    {
      ...,
      "snippet name": { // it should be snippet_name. Notice the _
        ...
      }
    }
    

    So make sure that:

    1. You have a {name}.code-snippets file under .vscode folder
    2. The name of your snippet does not contain spaces
    3. You include your language in the scope. I had to add both typescript and typescriptreact.

提交回复
热议问题