|
1 | 1 | {-# OPTIONS_GHC -Wno-orphans #-} |
2 | | -{-# LANGUAGE CPP #-} |
3 | 2 | module Development.IDE.Main |
4 | 3 | (Arguments(..) |
5 | 4 | ,Command(..) |
@@ -27,7 +26,8 @@ import qualified Data.Text.IO as T |
27 | 26 | import Data.Text.Lazy.Encoding (decodeUtf8) |
28 | 27 | import qualified Data.Text.Lazy.IO as LT |
29 | 28 | import Development.IDE (Action, Rules, |
30 | | - hDuplicateTo') |
| 29 | + hDuplicateTo', |
| 30 | + isOverGhc9) |
31 | 31 | import Development.IDE.Core.Debouncer (Debouncer, |
32 | 32 | newAsyncDebouncer) |
33 | 33 | import Development.IDE.Core.FileStore (isWatchSupported, |
@@ -86,9 +86,7 @@ import Ide.Types (IdeCommand (IdeCommand), |
86 | 86 | PluginId (PluginId), |
87 | 87 | ipMap) |
88 | 88 | import qualified Language.LSP.Server as LSP |
89 | | -#if (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(9,0,1,0))) |
90 | 89 | import qualified Language.LSP.Types as LSP |
91 | | -#endif |
92 | 90 | import Options.Applicative hiding (action) |
93 | 91 | import qualified System.Directory.Extra as IO |
94 | 92 | import System.Exit (ExitCode (ExitFailure), |
@@ -260,14 +258,13 @@ defaultMain Arguments{..} = do |
260 | 258 | , optRunSubset = runSubset |
261 | 259 | } |
262 | 260 | 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 $ |
| 261 | + -- FIXME: Remove this after GHC 9 gets fully supported |
| 262 | + when isOverGhc9 $ |
| 263 | + LSP.runLspT env $ |
266 | 264 | LSP.sendNotification LSP.SWindowShowMessage $ |
267 | 265 | LSP.ShowMessageParams LSP.MtWarning $ |
268 | 266 | "Currently, HLS supports GHC 9 only partially. " |
269 | 267 | <> "See [issue #297](https://github.com/haskell/haskell-language-server/issues/297) for more detail." |
270 | | -#endif |
271 | 268 | initialise |
272 | 269 | argsDefaultHlsConfig |
273 | 270 | rules |
|
0 commit comments