用于多行变量的Intellij Idea javascript格式
因此,我花了大量时间试图让intellij中的javascript代码样式选项实现我想要的功能,但还没有找到解决方案。 如果我用这样的注释声明了multple vars用于多行变量的Intellij Idea javascript格式,javascript,intellij-idea,formatting,Javascript,Intellij Idea,Formatting,因此,我花了大量时间试图让intellij中的javascript代码样式选项实现我想要的功能,但还没有找到解决方案。 如果我用这样的注释声明了multple vars var obj = { a: 1, b: 2, c: 'three', value1: 'abc', // This is the comment about the. next var value3: 'four; 然后我格式化我最终得到的代码 var obj = { a: 1, b: 2,
var obj = {
a: 1,
b: 2,
c: 'three',
value1: 'abc',
// This is the comment about the. next var
value3: 'four;
然后我格式化我最终得到的代码
var obj = {
a: 1,
b: 2,
c: 'three',
value1: 'abc',
// This is the comment about the next var
value3: 'four;
是否有保留注释缩进的方法?我在链式函数上看到类似的行为
angular.module('aModule', [])
/**
* This is a controller
*/
.controller('MyCtrl', function($scope) {
$scope = [1,2,3];
});
格式化文件
angular.module('aModule', [])
/**
* This is a controller
*/
.controller('MyCtrl', function($scope) {
$scope = [1,2,3];
});
我用的是intellij创意13。谢谢 项目设置-代码样式-JavaScript-包装和大括号-勾选第一列的注释这对于多行变量是正确的。还有一些其他格式的副作用,但值得更新。第二个带有链式函数的部分已被确定为intellij中的一个bug,存在一个未决问题。