【发布时间】:2020-01-13 01:54:38
【问题描述】:
我正在尝试为 python 制作一个 vscode sn-p。 假设我有这样一行代码:
my_var = call_some_function()
我想双击 my_var 来选择它,按一个键,它会产生以下结果:
my_var = call_some_function()
LOGGER.debug("my_var: %s", my_var)
<cursor is here>
它也应该适用于表达式,比如我在这一行中选择“x + y + z”并按下键:
call_function(x + y + z)
它应该产生:
call_function(x + y + z)
LOGGER.debug("x + y + z: %s", x + y + z)
<cursor is here>
显然使用调试器更好。但有时你不能使用调试器。
【问题讨论】:
标签: visual-studio-code code-snippets