Open core-ai-bot opened 3 years ago
Comment by architectcodes Wednesday Apr 30, 2014 at 17:48 GMT
AngularJS proposes a coding style which could possibly be easier to implement. How about that?
$someModule.
doStuff().
doMoreStuff();
Comment by FezVrasta Sunday May 04, 2014 at 07:00 GMT
Would be still better then the current behavior.
Comment by njx Monday May 05, 2014 at 18:58 GMT
Reviewed. One way we could do this is by making .
an electric char when it's at the beginning of a line in JS. Not sure if we would also have to make changes in the CM mode though.
Marking low priority to me.
Comment by FezVrasta Tuesday May 06, 2014 at 07:21 GMT
.
is a very "not specific" character and make it electric could interfere with other stuff...
Remember we have to handle even when someone uses alias for the $
char, example:
jQuery('#sth')
.remove();
or
var sth = $;
sth('#something')
.remove();
Comment by MarcelGerber Tuesday May 06, 2014 at 16:38 GMT
I guess it would be ok to just check whether the previous line ends with a semicolon or not.
Comment by architectcodes Wednesday May 14, 2014 at 17:50 GMT
@
SAPlayer, that's a perfectly simple idea in my opinion. Less is more.
Works also for the AngularJS coding style.
The only problem I see is that some developers still don't use semicolons at the end of the line. Perhaps the behaviour you propose could be toggled by using strict mode? That would also encourage some of those sloppier devs to switch to coding in strict mode :)
Comment by njx Wednesday May 14, 2014 at 17:58 GMT
@
tomekwi I don't think strict mode requires semicolons, unfortunately.
Comment by peterflynn Wednesday May 14, 2014 at 23:44 GMT
Yeah, it seems like this would require two changes:
Comment by MarcelGerber Friday May 16, 2014 at 15:11 GMT
@
peterflynn I guess it's better implemented in CM (maybe with an option) 'cause it's valid JS coding style, which should also be supported by pure CM.
Issue by FezVrasta Monday Apr 28, 2014 at 06:56 GMT Originally opened as https://github.com/adobe/brackets/issues/7672
When I write Javascript jQuery code I get this automatic indentation:
Instead, following the jQuery line guides it should be:
There are chances this problem will be fixed? Thanks