Visual Studio Code user snippets not working

后端 未结 18 2035
遥遥无期
遥遥无期 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 02:49

    Install CodeLLDB platform package from vscode extension market. It should be fix your problem

    0 讨论(0)
  • 2021-02-01 02:52

    Sometimes the obvious that gets overlooked first. Upon starting VSCode and creating a new document (Ctrl + N) it may come as a surprise that the snippets do not work. Check in the bottom right hand corner of the VSCode editor as per default a 'Plain Text' file is presented. Change the file type to your favourite language with snippets.

    This may overcome some unnecessary trouble shooting ;-)

    0 讨论(0)
  • 2021-02-01 02:52

    Simply Restart VScode. That should be fine.

    0 讨论(0)
  • 2021-02-01 02:52

    In case anyone else has this issue, I was working with react native and my JavaScript snippets weren't working. I checked settings.json by going to settings, searched for quick suggestions, and then edit in settings.json.

      "files.associations": {
        "*.js": "javascriptreact" // This needed changed to "javascript".
      }
    

    Otherwise, you can create the snippets for javascriptreact.

    0 讨论(0)
  • 2021-02-01 02:55

    I was experiencing this issue too when I created my first snippet. I added the snippet, and nothing happened.

    Restarted VS Code and they started working.

    0 讨论(0)
  • 2021-02-01 02:55

    For anyone else facing this, be sure to also check the scope defined within the snippet. Snippets weren't showing up for me although the file type matches, and removing the languages from the scoped solved the issue for me.

    0 讨论(0)
提交回复
热议问题