在VSCODE代码段中添加美元符号($)

发布于 2025-01-30 04:19:12 字数 562 浏览 3 评论 0原文

我正在为 vscode 中的Verilog文件编写自定义代码片段; vscode使用 json 文件。
我观察到 $ 在完成之前和DumpVars语句使用摘要时不会打印出来 我已经尝试在$之前添加\,但是没有工作。
有什么办法可以在片段中插入$?

这是我正在使用的相关代码块:

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

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."
    },

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

遗忘曾经 2025-02-06 04:19:12

使用双反斜向逃脱它,例如\\ $

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

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."
},
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文