Support ghc 9.4 for hls-class-plugin (#3258)

* Support ghc 9.4 for hls-class-plugin

* Update support table

* Update test description

* Update nix dependency
This commit is contained in:
Lei Zhu 2022-10-16 23:56:43 +08:00 committed by GitHub
parent e36208bf72
commit 8cef7a456a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 14 additions and 18 deletions

View File

@ -169,7 +169,7 @@ jobs:
name: Test hls-floskell-plugin
run: cabal test hls-floskell-plugin --test-options="$TEST_OPTS" || cabal test hls-floskell-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-floskell-plugin --test-options="$TEST_OPTS"
- if: matrix.test && matrix.ghc != '9.4.2'
- if: matrix.test
name: Test hls-class-plugin
run: cabal test hls-class-plugin --test-options="$TEST_OPTS" || cabal test hls-class-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-class-plugin --test-options="$TEST_OPTS"

View File

@ -48,7 +48,7 @@ package *
write-ghc-environment-files: never
index-state: 2022-09-14T16:53:13Z
index-state: 2022-10-07T12:19:15Z
constraints:
-- For GHC 9.4, older versions of entropy fail to build on Windows

View File

@ -25,7 +25,7 @@ let
ptr-poker = hself.callCabal2nix "ptr-poker" inputs.ptr-poker { };
ghc-exactprint =
hself.callCabal2nix "ghc-exactprint" inputs.ghc-exactprint-150 { };
hself.callCabal2nix "ghc-exactprint" inputs.ghc-exactprint-160 { };
# Hlint is still broken
hlint = doJailbreak (hself.callCabal2nix "hlint" inputs.hlint { });

View File

@ -46,7 +46,7 @@ For example, a plugin to provide a formatter which has itself been abandoned has
| `hls-pragmas-plugin` | 1 | |
| `hls-refactor-plugin` | 1 | 9.4 |
| `hls-alternate-number-plugin` | 2 | |
| `hls-class-plugin` | 2 | 9.4 |
| `hls-class-plugin` | 2 | |
| `hls-change-type-signature-plugin` | 2 | |
| `hls-eval-plugin` | 2 | 9.4 |
| `hls-explicit-fixity-plugin` | 2 | |

View File

@ -39,6 +39,10 @@
url = "https://hackage.haskell.org/package/lsp-test-0.14.1.0/lsp-test-0.14.1.0.tar.gz";
flake = false;
};
ghc-exactprint-160 = {
url = "https://hackage.haskell.org/package/ghc-exactprint-1.6.0/ghc-exactprint-1.6.0.tar.gz";
flake = false;
};
ghc-exactprint-150 = {
url = "https://hackage.haskell.org/package/ghc-exactprint-1.5.0/ghc-exactprint-1.5.0.tar.gz";
flake = false;

View File

@ -201,7 +201,7 @@ flag dynamic
manual: True
common class
if flag(class) && (impl(ghc < 9.4.1) || flag(ignore-plugins-ghc-bounds))
if flag(class)
build-depends: hls-class-plugin ^>= 1.1
cpp-options: -Dhls_class
@ -271,7 +271,7 @@ common splice
cpp-options: -Dhls_splice
common alternateNumberFormat
if flag(alternateNumberFormat)
if flag(alternateNumberFormat)
build-depends: hls-alternate-number-format-plugin ^>= 1.2
cpp-options: -Dhls_alternateNumberFormat

View File

@ -25,10 +25,6 @@ source-repository head
location: https://github.com/haskell/haskell-language-server.git
library
if impl(ghc >= 9.3)
buildable: False
else
buildable: True
exposed-modules: Ide.Plugin.Class
other-modules: Ide.Plugin.Class.CodeAction
, Ide.Plugin.Class.CodeLens
@ -53,9 +49,9 @@ library
, transformers
if impl(ghc >=9.2.1)
build-depends: ghc-exactprint ^>= 1.5
build-depends: ghc-exactprint >= 1.5
else
build-depends: ghc-exactprint >= 0.6.4 && <1.1
build-depends: ghc-exactprint >= 0.6.4 && <1.1
default-language: Haskell2010
default-extensions:
@ -66,10 +62,6 @@ library
ghc-options: -Wall -Wno-unticked-promoted-constructors -Wno-name-shadowing
test-suite tests
if impl(ghc >= 9.3)
buildable: False
else
buildable: True
type: exitcode-stdio-1.0
default-language: Haskell2010
hs-source-dirs: test

View File

@ -69,7 +69,7 @@ codeActionTests recorder = testGroup
executeCodeAction gAction
, goldenWithClass recorder "Creates a placeholder for other two methods" "T6" "2" $ \(_:_:ghAction:_) -> do
executeCodeAction ghAction
, onlyRunForGhcVersions [GHC92] "Only ghc-9.2 enabled GHC2021 implicitly" $
, onlyRunForGhcVersions [GHC92, GHC94] "Only ghc-9.2+ enabled GHC2021 implicitly" $
goldenWithClass recorder "Don't insert pragma with GHC2021" "InsertWithGHC2021Enabled" "" $ \(_:eqWithSig:_) -> do
executeCodeAction eqWithSig
, goldenWithClass recorder "Insert pragma if not exist" "InsertWithoutPragma" "" $ \(_:eqWithSig:_) -> do
@ -96,7 +96,7 @@ codeLensTests recorder = testGroup
, goldenCodeLens recorder "Apply code lens for local class" "LocalClassDefine" 0
, goldenCodeLens recorder "Apply code lens on the same line" "Inline" 0
, goldenCodeLens recorder "Don't insert pragma while existing" "CodeLensWithPragma" 0
, onlyRunForGhcVersions [GHC92] "Only ghc-9.2 enabled GHC2021 implicitly" $
, onlyRunForGhcVersions [GHC92, GHC94] "Only ghc-9.2+ enabled GHC2021 implicitly" $
goldenCodeLens recorder "Don't insert pragma while GHC2021 enabled" "CodeLensWithGHC2021" 0
, goldenCodeLens recorder "Qualified name" "Qualified" 0
, goldenCodeLens recorder "Type family" "TypeFamily" 0