Open isovector opened 3 years ago
Output of haskell-language-server --probe-tools or haskell-language-server-wrapper --probe-tools:
haskell-language-server --probe-tools
haskell-language-server-wrapper --probe-tools
haskell-language-server version: 1.0.0.0 (GHC: 8.8.4) (PATH: /home/sandy/.local/bin/haskell-language-server) (GIT hash: 25252164db6b2a01ccb0a7436009478ce2939f0a) Tool versions found on the $PATH cabal: 3.2.0.0 stack: 2.3.3 ghc: 8.10.4
Which lsp-client do you use: vim/coc
{-# LANGUAGE CPP #-} import Prelude #ifdef __GLASGOW_HASKELL__ import Data.Maybe #endif foo :: All foo = All True
Use the "ImportAll from Data.Monoid" code action.
All
Data.Monoid
import Prelude import Data.Monoid #ifdef __GLASGOW_HASKELL__ import Data.Maybe #endif
import Prelude #ifdef __GLASGOW_HASKELL__ import Data.Maybe import Data.Monoid #endif
Rather than using ifdef, consider if the CPP is #if __GLASGOW_HASKELL__ == 808, then your imports only get added for your current compiler version.
#if __GLASGOW_HASKELL__ == 808
I'm pretty sure that all our file edits are potentially incorrect in the presence of CPP. I don't know of any reasonable way to fix that.
Your environment
Output of
haskell-language-server --probe-tools
orhaskell-language-server-wrapper --probe-tools
:Which lsp-client do you use: vim/coc
Steps to reproduce
Use the "Import
All
fromData.Monoid
" code action.Expected behaviour
Actual behaviour
Why this is frustrating
Rather than using ifdef, consider if the CPP is
#if __GLASGOW_HASKELL__ == 808
, then your imports only get added for your current compiler version.