5

I would like to check a vscode typescript react snippet file into source code so that these can be distributed to developers.

At the moment, I'm editing a global snippet file under -[user]/AppData/Romaing/Code/Snippets/typescriptreact.json - so this works great for me locally. It would be even better if I could check this into my application code.

Any suggestions are appreciated -

Cheers

6
  • Looks like this might still be the best answer: stackoverflow.com/questions/42094206/… Commented Nov 9, 2018 at 2:52
  • I assumed that would work and I've tried this but no luck. Commented Nov 9, 2018 at 3:04
  • You tried the extension mentioned there? Commented Nov 9, 2018 at 3:08
  • You can check an extension.json file in under a .vscode directory in source which is all well and good. You can then reference an extension recommendation so when developers open VSCode, this will be listed as an option for them. However, I haven't been able to achieve a checked-in custom snippet file. Commented Nov 9, 2018 at 3:20
  • Possible duplicate of Change the snippets location in Visual Studio Code Commented Nov 9, 2018 at 21:27

1 Answer 1

0

You can check-in a .vscode/{filename}.code-snippets file which is interpreted as a JSON file. This can be used to define multi-language user-defined snippets. VSCode has documented it here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.