Skip to content

Commit edc9b5f

Browse files
committed
Send warning to LSP client when used on GHC 9
1 parent 3e07394 commit edc9b5f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ghcide/src/Development/IDE/Main.hs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# OPTIONS_GHC -Wno-orphans #-}
2+
{-# LANGUAGE CPP #-}
23
module Development.IDE.Main
34
(Arguments(..)
45
,Command(..)
@@ -76,6 +77,9 @@ import Ide.PluginUtils (allLspCmdIds',
7677
pluginDescToIdePlugins)
7778
import Ide.Types (IdePlugins)
7879
import qualified Language.LSP.Server as LSP
80+
#if (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(9,0,1,0)))
81+
import qualified Language.LSP.Types as LSP
82+
#endif
7983
import Options.Applicative hiding (action)
8084
import qualified System.Directory.Extra as IO
8185
import System.Exit (ExitCode (ExitFailure),
@@ -229,6 +233,14 @@ defaultMain Arguments{..} = do
229233
, optRunSubset = runSubset
230234
}
231235
caps = LSP.resClientCapabilities env
236+
-- FIXME: Remove this after GHC 9 gets fully supported
237+
#if (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(9,0,1,0)))
238+
LSP.runLspT env $
239+
LSP.sendNotification LSP.SWindowShowMessage $
240+
LSP.ShowMessageParams LSP.MtWarning $
241+
"Currently, HLS supports GHC 9 only partially. "
242+
<> "See [issue #297](https://github.com/haskell/haskell-language-server/issues/297) for more detail."
243+
#endif
232244
initialise
233245
argsDefaultHlsConfig
234246
rules

0 commit comments

Comments
 (0)