Unfortunately the answer is 'no' for all 3 questions:( Please feel free to file requests for these features to WebStorm issue tracker
Manual code-reformatting exceptions in Webstorm?
-
30-06-2022 - |
Question
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?
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow