Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ghc 9.4 for hls-hlint-plugin #3290

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ jobs:
name: Test hls-rename-plugin test suite
run: cabal test hls-rename-plugin --test-options="$TEST_OPTS" || cabal test hls-rename-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-rename-plugin --test-options="$TEST_OPTS"

- if: matrix.test && matrix.ghc != '9.4.2'
- if: matrix.test
name: Test hls-hlint-plugin test suite
run: cabal test hls-hlint-plugin --test-options="$TEST_OPTS" || cabal test hls-hlint-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-hlint-plugin --test-options="$TEST_OPTS"

Expand Down
7 changes: 6 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -76,6 +76,11 @@ source-repository-package
-- https://github.com/tibbe/ekg-json/pull/12
-- END DELETE

source-repository-package
type: git
location: https://github.com/July541/apply-refact.git
tag: dcaa4904f002280fe4a9590e9a2792d3a6bac489

allow-newer:
-- ghc-9.4
Chart-diagrams:lens,
Expand Down
4 changes: 2 additions & 2 deletions haskell-language-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ common tactic
cpp-options: -Dhls_tactic

common hlint
if flag(hlint) && (impl(ghc < 9.4.1) || flag(ignore-plugins-ghc-bounds))
if flag(hlint)
build-depends: hls-hlint-plugin ^>= 1.1
cpp-options: -Dhls_hlint

Expand All @@ -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

Expand Down
10 changes: 1 addition & 9 deletions plugins/hls-hlint-plugin/hls-hlint-plugin.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ flag pedantic
manual: True

library
if impl(ghc >= 9.3)
buildable: False
else
buildable: True
exposed-modules: Ide.Plugin.Hlint
hs-source-dirs: src
build-depends:
Expand All @@ -51,7 +47,7 @@ library
, ghc-exactprint >=0.6.3.4
, ghcide ^>=1.8
, hashable
, hlint < 3.5
, hlint < 3.6
, hls-plugin-api ^>=1.5
, hslogger
, lens
Expand Down Expand Up @@ -81,10 +77,6 @@ library
TypeOperators

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
Expand Down
5 changes: 4 additions & 1 deletion plugins/hls-hlint-plugin/src/Ide/Plugin/Hlint.hs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ import Development.IDE.GHC.Compat (DynFlags,
wopt)
import qualified Development.IDE.GHC.Compat.Util as EnumSet

#if MIN_GHC_API_VERSION(9,4,0)
import qualified "ghc-lib-parser" GHC.Data.Strict as Strict
#endif
#if MIN_GHC_API_VERSION(9,0,0)
import "ghc-lib-parser" GHC.Types.SrcLoc hiding
(RealSrcSpan)
Expand Down Expand Up @@ -157,7 +160,7 @@ instance Pretty Log where
#if !MIN_GHC_API_VERSION(9,0,0)
type BufSpan = ()
#endif
pattern RealSrcSpan :: GHC.RealSrcSpan -> Maybe BufSpan -> GHC.SrcSpan
pattern RealSrcSpan :: GHC.RealSrcSpan -> Strict.Maybe BufSpan -> GHC.SrcSpan
#if MIN_GHC_API_VERSION(9,0,0)
pattern RealSrcSpan x y = GHC.RealSrcSpan x y
#else
Expand Down
4 changes: 2 additions & 2 deletions plugins/hls-hlint-plugin/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ suggestionsTests =
doc <- openDoc "IgnoreAnnHlint.hs" "haskell"
expectNoMoreDiagnostics 3 doc "hlint"

, knownBrokenForGhcVersions [GHC92] "apply-refact has different behavior on v0.10" $
, knownBrokenForGhcVersions [GHC92, GHC94] "apply-refact has different behavior on v0.10+" $
testCase "apply-refact preserve regular comments" $ runHlintSession "" $ do
testRefactor "Comments.hs" "Redundant bracket" expectedComments

, onlyRunForGhcVersions [GHC92] "only run test for apply-refact-0.10" $
, onlyRunForGhcVersions [GHC92, GHC94] "only run test for apply-refact-0.10+" $
testCase "apply-refact preserve regular comments" $ runHlintSession "" $ do
testRefactor "Comments.hs" "Redundant bracket" expectedComments'

Expand Down