Closed
Description
Your environment
Output of haskell-language-server --probe-tools
or haskell-language-server-wrapper --probe-tools
:
haskell-language-server version: 1.3.0.0 (GHC: 9.0.1) (PATH: $PATH/haskell-language-server) (GIT hash: 2857eeece0398e1cd4b2ffb6069b05c4d2308b39)
Tool versions found on the $PATH
cabal: 3.4.0.0
stack: 2.7.1
ghc: 8.10.5
Which OS do you use: Manjaro
Which lsp-client do you use: Emacs
Describe your project (alternative: link to the project):
Contents of hie.yaml
: Implicit
Steps to reproduce
With this file,
module Test where
useLex :: String
useLex = lex "" -- 'lex' can be either the local definition or 'Prelude.lex'.
lex :: String -> String
lex = id
HLS does not give "Use local, hiding imports" or similar, and just shows "Replace with qualified: Prelude.lex". This works well when ambiguity is caused by two imported definitions.
Expected behaviour
Described as above.
Actual behaviour
Described as above.
Related information
haskell-language-server/ghcide/src/Development/IDE/Plugin/CodeAction.hs
Lines 886 to 900 in 2fef041
checks only "imported from ...", whereas the actual error message with local definition is "defined at ...".