3

I was writing my custom code snippets for verilog files in VScode; VSCode uses JSON files for it.
I observed that $ before finish and dumpvars statements doesn't get printed when I use the snippet since it is a built-in keyword for including variables in strings in json file format, I have tried adding \ before $ but that didn't work.
Is there any way I can insert $ in my snippets?

This is the relevant code block I am using:

"dump statements": {
        "prefix": "dump",
        "body": [
            "initial begin", 
            "   dumpfile(\"${1:filename}\");",
            "   \$dumpvars();",
            "end"
        ],
        "description": "Prints the dump file and variables statements."
    },

1 Answer 1

2

Use a double backslash to escape it, like this \\$

"dump statements": {
    "prefix": "dump",
    "body": [
        "initial begin", 
        "   dumpfile(\"${1:filename}\");",
        "   \\$dumpvars();",
        "end"
    ],
    "description": "Prints the dump file and variables statements."
},
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.