Skip to content

Commit b8bb06e

Browse files
konnjneira
andauthored
Warn GHC 9 Compatibility to LSP Client (#1992)
* Test 9.0.1 for windows and macOS * Refactorize ghc checking in tests * Correct imports/exports * Replace CPP checks with ghcVersion * Use GHC cpp and remove 8.4 * Use the ghc version runtime checker * HLINT ann ignored for ghc-9 too * Mark test as broken for win and ghc-9 * Use GHC90 in eval tests * Avoid reformatting code * Remove not supported ghc-8.4 * Disable tests for macos and ghc-9.0.1 * Updates README to warn GHC 9 support situation * Send warning to LSP client when used on GHC 9 * Stop using CPP and adds ad-hoc version discover logic in Development.IDE.GHC.Util * Use ghcVersion check * Convert alert to log message Co-authored-by: jneira <atreyu.bbb@gmail.com>
1 parent 8edb0f7 commit b8bb06e

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ ghcup install hls
140140
If you are using [`chocolatey`](https://chocolatey.org/) to manage your installations in windows, [you can install `haskell-language-server`](https://community.chocolatey.org/packages/haskell-language-server) with
141141
```
142142
choco install haskell-language-server
143-
````
143+
````
144144
145145
### Visual Studio Code
146146
@@ -703,6 +703,11 @@ args = ["--lsp"]
703703
704704
## Known limitations
705705
706+
### Limited GHC 9 Support
707+
Currently, GHC 9 support in HLS is in beta stage; some features are unavailable with GHC >= 9.0.1 for the time being.
708+
This situation is expected to be resolved in the near future after all the dependent packages support GHC 9.
709+
See issue [#297](https://github.com/haskell/haskell-language-server/issues/297) for the supported features in GHC 9 and the status of migration progress.
710+
706711
### Preprocessor
707712
HLS is not yet able to find project preprocessors, which may result in `could not execute: <preprocessor>` errors. This problem is
708713
tracked in https://github.com/haskell/haskell-language-server/issues/176 and originally comes from https://github.com/mpickering/hie-bios/issues/125

ghcide/src/Development/IDE/Main.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ import qualified Data.Text as T
2525
import qualified Data.Text.IO as T
2626
import Data.Text.Lazy.Encoding (decodeUtf8)
2727
import qualified Data.Text.Lazy.IO as LT
28-
import Development.IDE (Action, Rules,
28+
import Development.IDE (Action, GhcVersion (..),
29+
Rules, ghcVersion,
2930
hDuplicateTo')
3031
import Development.IDE.Core.Debouncer (Debouncer,
3132
newAsyncDebouncer)
@@ -256,6 +257,11 @@ defaultMain Arguments{..} = do
256257
, optRunSubset = runSubset
257258
}
258259
caps = LSP.resClientCapabilities env
260+
-- FIXME: Remove this after GHC 9 gets fully supported
261+
when (ghcVersion == GHC90) $
262+
hPutStrLn stderr $
263+
"Currently, HLS supports GHC 9 only partially. "
264+
<> "See [issue #297](https://github.com/haskell/haskell-language-server/issues/297) for more detail."
259265
initialise
260266
argsDefaultHlsConfig
261267
rules

0 commit comments

Comments
 (0)