我希望有两个构建:对于JavaScript (节点)和茉莉节点。并根据文件扩展名(或其他条件),由崇高文本自动选择它们。我有:
JavaScript.sublime-build
{
"cmd": ["node", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.js"
}JasmineNode.sublime-build
{
"cmd": ["jasmine-node", "$file"],
"file_regex": "^.+\\((.+):([0-9]+)\\)$",
"selector": "source.spec.js"
}JavaScript构建总是在.spec.js文件上使用,而不是Jasmine,我不得不手动选择Jasmine。我如何使茉莉花自动构建工作?
发布于 2014-01-24 10:06:43
崇高的构建变体可以像这样使用:
{
"cmd": ["node", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.js",
"variants": [
{ "cmd": ["jasmine-node", "--noColor", "$file"],
"file_regex": "^.+\\((.+):([0-9]+)\\)$",
"name": "Test"
}
]
}然后,可以将一个变体分配给这样的热键:
{ "keys": ["shift+f7"], "command": "build", "args": {"variant": "Test"} }但是我认为应该有一种方法来选择.spec.js,而不是在文件名中选择.js。
https://stackoverflow.com/questions/21328639
复制相似问题