gleam-lang/gleam

Import module in code action to fill missing case patterns

Open

#3,568 opened on Aug 27, 2024

View on GitHub
 (8 comments) (0 reactions) (0 assignees)Rust (21,417 stars) (960 forks)batch import
help wanted

Description

Currently, if a user runs the "Add missing patterns" code action on this code:

case some_value.optional_field {}

They would get something like:

case some_value.optional_field {
  option.Some(_) -> todo
  option.None -> todo
}

Which is correct, but doesn't account for the fact that they need to import the gleam/option module. It would be helpful to detect this and automatically import gleam/option in this case.

Contributor guide

Import module in code action to fill missing case patterns · gleam-lang/gleam#3568 | Good First Issue