Typing a method annotiation (i.e. @isTest) and pressing return starts the next line indented
If you try and type something like:
@isTest
static void blah(){}
You'll instead get
@isTest
static void blah(){}
It appears that starting with the annotiation first on it's own line causes IC to see the next line as a continuation and apply the (by default) 8-space continuation indent. Since it's a method level annotation this isn't right - the method should be at the same indent level as the annotations on it according to all code styles I've seen to date.
Comments (6)
-
repo owner -
Account Deactivated I'd love to see this fixed. Minor annoyance when I write unit tests (which is almost every day). Small workaround I've done is put a test method below the ones I want to write, and then it will format fine. See below.
@isTest private class TestClass { // Write tests here with @isTest annotation and they will format without issue because of the test below. @isTest private static void notARealTest() {} }
-
repo owner Thanks for the feedback. I'll see if I can include this in a near-term update.
-
repo owner -
repo owner Okay, this will be fixed in the next build, not just for
@IsTest
for but all annotations typed as the leading part of a new declaration. -
repo owner - changed status to resolved
Delivered in 1.7.8.6.
- Log in to comment
Funny...here's a TODO I left for myself in the formatter: