Skip to content

Case split refers to out of scope patterns without adding imports or qualifying #5084

Description

@Jashweii

This isn't really an issue for me currently (hence the contrived hide prelude example) but thought it was worth raising regardless. I think not using a qualified name if available is probably a bigger problem than not auto importing because you might be matching something with many patterns you don't want to bring into the normal scope. (Also beware of qualified operators.)

Your environment

Windows
GHC 9.14.1 (from HLS)
Project build by cabal (but probably possible in a single file)
VSCode + vscode-haskell
HLS 2.15.0.0 via ghcup compile
Config - HLS managed by PATH, semantic tokens on

Steps to reproduce

Complete the \case

module MyLib where
import Prelude (Maybe)
-- import qualified Data.Maybe -- doesn't fix the issue

test :: Maybe a -> ()
test = \case

Expected behaviour

It will auto-import (somehow) similar to auto-completion, or use a qualified name if available (e.g. the various correction suggestions HLS will give after the change).

Actual behaviour

It will refer to (out of scope) Just and Nothing

Debug information

None

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

component: hls-case-split-pluginIssues related to the hls-case-split-pluginstatus: needs reviewThis PR is ready for reviewtype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions