我正在为 VScode 中的 verilog 文件编写自定义代码片段; VSCode 为此使用 JSON 文件。
我观察到 $ before finish 和 dumpvars 语句在我使用该代码段时不会被打印出来,因为它是一个内置关键字,用于在 json 文件格式的字符串中包含变量,
我试过在 $ 之前添加\但那没有 起作用。
有什么方法可以在我的代码片段中插入 $ 吗?
这是我正在使用的相关代码块:
"dump statements": {
"prefix": "dump",
"body": [
"initial begin",
" dumpfile(\"${1:filename}\");",
" \$dumpvars();",
"end"
],
"description": "Prints the dump file and variables statements."
},
最佳答案
使用双反斜杠对其进行转义,例如 \\$
"dump statements": {
"prefix": "dump",
"body": [
"initial begin",
" dumpfile(\"${1:filename}\");",
" \\$dumpvars();",
"end"
],
"description": "Prints the dump file and variables statements."
},
关于json - 在 VScode 代码片段中添加美元符号 ($),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72274207/