Indentation of multi-line statements

2 posts, 0 answers
  1. Patrick Barranis
    Patrick Barranis avatar
    68 posts
    Member since:
    Jul 2009

    Posted 23 Jun 2013 Link to this post

    I would like JustCode to format my multi-line statements like so:

    List<InventoryHistory> inspectionInventoryHistories = _context.GetAllInventoryHistories(_activity.Id)
        .OrderByDescending(ih => ih.Inventory.Type.SortOrder)
        .ThenBy(ih => ih.Inventory.Type.Value)
        .ToList();


    But instead it is formatting it like this:

    List<InventoryHistory> inspectionInventoryHistories = _context.GetAllInventoryHistories(_activity.Id)
                                           .OrderByDescending(ih => ih.Inventory.Type.SortOrder)
                                           .ThenBy(ih => ih.Inventory.Type.Value)
                                           .ToList();

    Which settings, exactly, do I set to make it do this?

  2. Borislav
    Admin
    Borislav avatar
    35 posts

    Posted 24 Jun 2013 Link to this post

    Hello Patrick,

    You can customize how those chained method invocations are formatted from here:
    JustCode menu -> Options -> Code Style -> C# -> Wrapping -> Chained Method Invocations section.
    Try playing with those settings and see how your code is going to be formatted in the preview box at the bottom of the page.

    You can change the indentation to the one you want just by changing the value of "Indent" combo-box from "Indent at column" to "Indent".

    Please contact us if you have any other questions or suggestions.

    Regards,
    Borislav
    Telerik
    Share what you think about JustCode with us, so we can help you even better! You can use the built-in feedback tool inside JustCode, our forum, or our JustCode feedback portal.
  3. DevCraft banner
Back to Top