문제

While I'm generally in enthusiastic about Webstorm code reformatting, I have some personal preferences that Webstorm doesn't (yet) understand. So I wish I could have a bit more control.

For example, I use RequireJS and AngularJS, both of which have a concept of module that takes a list of dependencies and a function with corresponding parameters. I like to line them up. E.g., RequireJS:

define  (['jquery', 'angular', 'gmaps'],
function ( $      ,  angular ) {

And AngularJS:

Module.controller('MyController', ['$scope', '$element', '$attrs',
                         function ( $scope ,  $element ,  $attrs) {

These are exceptions to my usual formatting preferences that don't survive code reformatting. I'd like to have Webstorm work with me, rather than against me.

In order of preference:

  • Can I program this as a reformatting behavior into Webstorm?
  • Can I ask Webstorm to ignore spacing for this kind of construct? (Based on function name, perhaps, or some sort of pattern matching on the code?)
  • Can I ask Webstorm to ignore spacing altogether?
도움이 되었습니까?

해결책

Unfortunately the answer is 'no' for all 3 questions:( Please feel free to file requests for these features to WebStorm issue tracker

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top