繁体   English   中英

在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",
};

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

目前无法使用,请投票给WEB-13348

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM