gleam-lang/gleam

Import module in code action to fill missing case patterns

Open

#3,568 opened on 2024年8月27日

GitHub で見る
 (8 comments) (0 reactions) (0 assignees)Rust (960 forks)batch import
help wanted

Repository metrics

Stars
 (21,417 stars)
PR merge metrics
 (平均マージ 10d 19h) (30d で 69 merged PRs)

説明

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.

コントリビューターガイド