Skip to content

Import unqualified code action #4613

@mine-tech-oficial

Description

@mine-tech-oficial

Given an unknown record constructors/type, it would be nice if a code action is available to add an unqualified import for it. It wouldn't work for constants, as it isn't recommended to encourage importing of unqualified values (as Louis said in #4304 (comment)).

Example:

import gleam/option

fn a() {
    Some(1)
}

becomes

import gleam/option.{Some}

fn a() {
    Some(1)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions