Skip to content

Feature request: Group includes by directory (insert empty lines) #16

Description

@goran-w

In order to sort across all include-groups, we first need to remove the empty lines between the groups (see also issue #15).

To re-group includes after sorting (by inserting new empty lines), I'd suggest adding an option to "Group Includes by Directory". ReSharper C++ has a similar feature, see the following pages:

Grouping by "full path depth" (deepest directory level) would be a good place to start:

#include "core/misc/log/log.h
#include "core/misc/log/log_utils.h

#include "core/misc/threads/threads.h

#include "core/render/dx/render_dx.h

#include "core/render/gl/render_gl.h

#include "products/product_1/main.h
#include "products/product_1/product.h

#include "products/product_2/main.h
#include "products/product_2/product.h

Ideally though, I'd like to specify at which "path depth" (1 or larger) we want the grouping to happen - so that, for example, for a depth of 2 we would get the following groupings:

#include "core/misc/log/log.h
#include "core/misc/log/log_utils.h
#include "core/misc/threads/threads.h

#include "core/render/dx/render_dx.h
#include "core/render/gl/render_gl.h

#include "products/product_1/main.h
#include "products/product_1/product.h

#include "products/product_2/main.h
#include "products/product_2/product.h

NOTE: Specifying a depth of 0 (zero) could then mean "no grouping"...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions