在 PhpStorm IDE 中完成时向 JavaScript 元素添加逗号

Add comma to JavaScript element on completion in PhpStorm IDE

我喜欢简化我的工作流程,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",
};

请注意,我指的不是数组最后一个元素或对象最后一个 属性 上的尾随逗号。 如果有帮助,我可以 post 我的配置。

这目前不起作用,请投票给WEB-13348