【发布时间】:2021-11-23 13:22:05
【问题描述】:
我有以下VS Code的global-sn-p代码
"prints formated path": {
"prefix": "pp",
"body": [
"$BLOCK_COMMENT_START",
"File Path -> \"${TM_FILEPATH/\\///g}\"",
"$BLOCK_COMMENT_END",
],
"description": "prints path"
},
上面sn-p的输出是
"""
File Path -> "D:\tp\New folder (6)\4. Chapter 4 Packaging\my_package\test.py"
"""
预期的输出是
"""
File Path -> "D:/tp/New folder (6)/4. Chapter 4 Packaging/my_package/test.py"
"""
其实我想把 '\' 换成 '/'
在网上搜索太多后,我找到了this page,它谈到了Variable Transformation in VS Code,但它对我没有帮助。 如果您知道问题的解决方案,请提出建议
【问题讨论】:
标签: visual-studio-code replace path vscode-snippets