我喜欢简化我的工作流程,PhpStorm 在这方面确实帮助了我。
当我在 php 代码模板中创建数组时,我可以使用 shift + ⌘ + ↵ 来完成当前声明
$array = [
'key'**TextCusrorHere** => 'value'
'anotherkey' => 'anothervalue',
];
当我在文本光标所在位置调用完成当前语句命令时,会发生以下情况:
$array = [
'key' => 'value', // note the comma gets added to the end of the line
**TextCursorHere**
'anotherKey' => 'anotherValue',
];
现在我的问题是在 JavaScript 文件中进行编辑时不会出现相同的功能。
例如:
var object = {
key**TextCursorHere**: "value"
anotherKey: "anotherValue",
};
当我在文本光标所在位置调用完成当前语句命令时,会发生以下情况:
var object = {
key: "value" // note that the comma DOES NOT get added
**TextCursorHere**
anotherKey: "anotherValue",
};
请注意,我并不是指数组最后一个元素或对象最后一个属性上的尾随逗号。 如果有帮助的话我可以发布我的配置。
最佳答案
此功能目前不起作用,请投票给 WEB-13348
关于javascript - 在 PhpStorm IDE 中完成时向 JavaScript 元素添加逗号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42387763/