1

Why markdown language not seems to be supported by code-snippets in vs-code? I've also tried writing "scope: "md" but it also doesn't work.

{
    "Print to console": {
        "scope": "markdown",
        "prefix": "test",
        "body": [
            "console.log('$1');",
            "$2"
        ],
        "description": "description"
    }
}
2

1 Answer 1

2

Create some of the other snippet files like html.json.

Save this file with File | Save As... as markdown.json in the same directory.

Fill in your snippet.

In the Markdown file type your snippet prefix and press CtrlSpace and select the snippet you want.

It seems there is not a completion provider that shows the possible completions while you type or it is not enabled by default.

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

5 Comments

Actually completion provider is enabled because snippets for all other language is working correctly but not this one.
This works for me. I was actually creating the global snippet and writing the scope: markdown but it seems that rather than select global snippet i have to select markdown language snippets option.
@ShantanuTripathi A completion provider is bound to a language on construction
So why does adding global snippets works for python, cpp, java and all other languages but not for markdown?
@ShantanuTripathi Maybe if you define snippets in the package.json of an extension you get an implicit completion provider for that language

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.