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
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
\caseExpected 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)
JustandNothingDebug information
None