Skip to content

Commit ef9d871

Browse files
konnjneira
authored andcommitted
Send warning to LSP client when used on GHC 9
1 parent 16ace4a commit ef9d871

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(..)
@@ -85,6 +86,9 @@ import Ide.Types (IdeCommand (IdeCommand),
8586
PluginId (PluginId),
8687
ipMap)
8788
import qualified Language.LSP.Server as LSP
89+
#if (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(9,0,1,0)))
90+
import qualified Language.LSP.Types as LSP
91+
#endif
8892
import Options.Applicative hiding (action)
8993
import qualified System.Directory.Extra as IO
9094
import System.Exit (ExitCode (ExitFailure),
@@ -256,6 +260,14 @@ defaultMain Arguments{..} = do
256260
, optRunSubset = runSubset
257261
}
258262
caps = LSP.resClientCapabilities env
263+
-- FIXME: Remove this after GHC 9 gets fully supported
264+
#if (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(9,0,1,0)))
265+
LSP.runLspT env $
266+
LSP.sendNotification LSP.SWindowShowMessage $
267+
LSP.ShowMessageParams LSP.MtWarning $
268+
"Currently, HLS supports GHC 9 only partially. "
269+
<> "See [issue #297](https://github.com/haskell/haskell-language-server/issues/297) for more detail."
270+
#endif
259271
initialise
260272
argsDefaultHlsConfig
261273
rules

0 commit comments

Comments
 (0)