- edited description
Continuation indent working only on reset of initial value
Hi Scott,
I’m declaring a method and was wondering why the continuation indent was not working although set to 4:
public static Set<Id> getAccountIdsByCategory(List<String> categoryNumbers, Boolean queryBrand, List<String> brandNumbers) {
I toggled the continuation indent to 8 and voilà, a continuation indent of 8:
public static Set<Id> getAccountIdsByCategory(List<String> categoryNumbers, Boolean queryBrand, List<String> brandNumbers) {
I reset the continuation indent to 4 and now it worked:
public static Set<Id> getAccountIdsByCategory(List<String> categoryNumbers, Boolean queryBrand, List<String> brandNumbers) {
So it works but only after setting it to something else and then resetting it to the original value of 4.
Obviously a small bug, if it is one.
Btw I saw issue 1292 but still opened a new one, as I wasn’t sure if it’s the same.
Kind regards,
René
Comments (10)
-
reporter -
reporter - edited description
-
repo owner René, is this only happening to you as you're initially typing, e.g., when you type the following:
public void doSomething(String arg1,<ENTER>)
If so, it's because the parser hasn't quite determined that this is a method argument list. Once you change that to:
public void doSomething(String arg1, String arg2)
you can use either Auto-indent Lines or Reformat Code and it will align properly.
I'm not saying that this is behaving in an ideal manner, but I want to make sure that we're seeing the same behavior before I start looking at a potential fix as a fix may be tricky given the incomplete parser state at the first point above.
-
reporter Thank you Scott, understood. Probably I’m just not familiar enough with this
-
repo owner Well, it's certainly not quite acting as expected/desired. So you can confirm that it behaves as described above? If so, I can look into it a bit and see if there's something I can to do determine that it's a nascent method declaration and help it format properly even in invalid state.
-
reporter Hi Scott, yes exactly, it behaves as described above. If <ENTER> is done before the end of the signature but with nothing after <ENTER> (except the bracket), the continuation is not indented. Otherwise it is.
-
repo owner Thanks for confirming! I'll see if I can figure out how to get it to handle this situation properly even though it's in a partially-formed parser state. I'm sure there's some recognizable context I can use for the formatting rule.
-
repo owner Fix committed for the next build that addresses this issue in declaration formal parameter lists, invocation argument lists, trigger context lists, SOQL
IN
clause lists, and SOQLWITH RecordVisibilityContext
config params. -
reporter Scott thank you so much. Your dedication is unparalleled
-
repo owner - changed status to resolved
Delivered in 2.1.5.3.
- Log in to comment