Skip to content

auto-import and importing completions should add the use statement after any header comments #8607

@wtfsck

Description

@wtfsck

Repro:

  • Move to HashSet and press Ctrl+. in VSCode and import it
// Some license header

fn main() {
    let hset: Option<HashSet<usize>> = None;
}

Result:

use std::collections::HashSet;

// Some license header

fn main() {
    let hset: Option<HashSet<usize>> = None;
}

Expected result:

// Some license header

use std::collections::HashSet;

fn main() {
    let hset: Option<HashSet<usize>> = None;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-assistsE-has-instructionsIssue has some instructions and pointers to code to get startedS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions