5

In Visual Studio Code, snippets is not work in comments or string. For example, I create snippet 't' for 'test', then type 't' in comment like

# t

or in string like

"this is a string t"

then there no suggestion and press 'tab' is not work.

How to use snippets in comment and string, in visual studio code?

1 Answer 1

6

In User Setting, put the following:

"editor.quickSuggestions": {
    "comments": true,
    "strings": true
  },
Sign up to request clarification or add additional context in comments.

2 Comments

How to find where to put it: Command+P settings.json or through the nav bar: Code > Preferences > Settings > search for 'quick' > click the result to 'edit in settings.json'
This also works for workspace settings (/.vscode/settings.json)

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.