Skip to content

Sort Active Import Block is broken for scoped and versioned imports #231

@ghost91-

Description

@ghost91-

When using "Sort Active Import Block" with scoped imports, the following happens:

void main()
{
    import std.stdio;
    import std.algorithm;

    writeln("foo");
}

gets changed to

import std.algorithm;
import std.stdio;

    writeln("foo");
}

When calling it with

void main()
{
    import std.stdio;
    import std.algorithm;
}

nothing happens at all.

When using it with versioned imports, the following happens:

version(unittest)
    import std.tratis;
import std.stdio;
import std.algorithm;

void main()
{
}

gets changed to

import std.algorithm;
import std.stdio;
import std.tratis;

void main()
{
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions