为VSCode创建自定义代码段后,如何执行/运行它?
我创建了这个JavaScript测试代码段:
{
"sns": {
"prefix": "sns",
"body": [
"var http = require(\"http\");",
"",
"http.createServer(function(request, response) {",
" response.writeHead(200, {\"Content-Type\": \"text/plain\"});",
" response.write(\"This is a response...\");",
" response.end();",
"}).listen(8888);"
],
"description": "Simple node server code"
}
}
我该如何触发它?
答案 0 :(得分:-1)
我通常使用Code Runner
扩展程序来运行代码段,我希望这会有所帮助。
https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner