3

我目前正在使用 SublimeText2 的js-beautify插件并编辑.jsbeautifyrc. 我无法在配置文档中找到我认为可操作的属性:preserve comment indentation

我想要的输出与我的初始格式匹配:

// This comment isn't indented so I can fold all of the code it refers to
   function fooBar() {
      ... do stuff
   };

注释可以嵌套在另一个函数中:

var fooBar = fooBar || (function() {
// Unindented comment for folding
   function fooBar() {
      ... do stuff
   };
}());

或者在嵌套对象/数组中:

foo: {
// Another unindented comment for folding
  bar: {
    ... more stuff
  },
// Yet another unindented comment
  baz: [
    ... even more stuff
  ]
}

我试过keep_comment_indentation无济于事。

4

0 回答 0