Skip to content
Merged
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/actions/setup-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
cabal:
description: "Cabal version"
required: false
default: "3.14.2.0"
default: "3.16.1.0"
os:
description: "Operating system: Linux, Windows or macOS"
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/supported-ghc-versions.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["9.12", "9.10", "9.8", "9.6"]
["9.14", "9.12", "9.10", "9.8", "9.6"]
104 changes: 55 additions & 49 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ jobs:
# 9.10.3 is broken on windows
- os: windows-latest
ghc: "9.10"
env:
# We choose a very short build directory, as we run into long path issues on windows.
# See cabal tracking issue https://github.com/haskell/cabal/issues/11395
# We can't set the `--builddir` via `v2-configure` as cabal doesn't support this.
# https://github.com/haskell/cabal/issues/5271
CABAL_ARGS: "--builddir b"

steps:
- uses: actions/checkout@v3
Expand All @@ -105,7 +111,7 @@ jobs:
os: ${{ runner.os }}

- name: Build
run: cabal build all
run: cabal build ${CABAL_ARGS} all

- name: Set test options
# See https://github.com/ocharles/tasty-rerun/issues/22 for why we need
Expand All @@ -116,161 +122,161 @@ jobs:

- if: matrix.test
name: Test hls-graph
run: cabal test hls-graph
run: cabal test ${CABAL_ARGS} hls-graph

- if: needs.pre_job.outputs.should_skip_ghcide != 'true' && matrix.test
name: Test ghcide
# run the tests without parallelism to avoid running out of memory
run: cabal test ghcide-tests || cabal test ghcide-tests
run: cabal test ${CABAL_ARGS} ghcide-tests || cabal test ${CABAL_ARGS} ghcide-tests

- if: matrix.test
name: Test hls-plugin-api
run: cabal test hls-plugin-api || cabal test hls-plugin-api
run: cabal test ${CABAL_ARGS} hls-plugin-api || cabal test ${CABAL_ARGS} hls-plugin-api

- if: matrix.test
name: Test func-test suite
env:
HLS_TEST_EXE: hls
HLS_WRAPPER_TEST_EXE: hls-wrapper
run: cabal test func-test || cabal test func-test
run: cabal test ${CABAL_ARGS} func-test || cabal test ${CABAL_ARGS} func-test

- if: matrix.test
name: Test wrapper-test suite
env:
HLS_TEST_EXE: hls
HLS_WRAPPER_TEST_EXE: hls-wrapper
run: cabal test wrapper-test
run: cabal test ${CABAL_ARGS} wrapper-test

- if: matrix.test
name: Test hls-refactor-plugin
run: cabal test hls-refactor-plugin-tests || cabal test hls-refactor-plugin-tests
run: cabal test ${CABAL_ARGS} hls-refactor-plugin-tests || cabal test ${CABAL_ARGS} hls-refactor-plugin-tests

# TODO enable when it supports 9.10
- if: matrix.test && matrix.ghc != '9.10' && matrix.ghc != '9.12' && matrix.ghc != '9.10.2'
- if: matrix.test && matrix.ghc != '9.10' && matrix.ghc != '9.12' && matrix.ghc != '9.14' && matrix.ghc != '9.10.2'
name: Test hls-floskell-plugin
run: cabal test hls-floskell-plugin-tests || cabal test hls-floskell-plugin-tests
run: cabal test ${CABAL_ARGS} hls-floskell-plugin-tests || cabal test ${CABAL_ARGS} hls-floskell-plugin-tests

- if: matrix.test
name: Test hls-class-plugin
run: cabal test hls-class-plugin-tests || cabal test hls-class-plugin-tests
run: cabal test ${CABAL_ARGS} hls-class-plugin-tests || cabal test ${CABAL_ARGS} hls-class-plugin-tests

- if: matrix.test
name: Test hls-pragmas-plugin
run: cabal test hls-pragmas-plugin-tests || cabal test hls-pragmas-plugin-tests
run: cabal test ${CABAL_ARGS} hls-pragmas-plugin-tests || cabal test ${CABAL_ARGS} hls-pragmas-plugin-tests

- if: matrix.test
name: Test hls-eval-plugin
run: cabal test hls-eval-plugin-tests || cabal test hls-eval-plugin-tests
run: cabal test ${CABAL_ARGS} hls-eval-plugin-tests || cabal test ${CABAL_ARGS} hls-eval-plugin-tests

# TODO enable when it supports 9.10
- if: matrix.test && matrix.ghc != '9.10' && matrix.ghc != '9.12' && matrix.ghc != '9.10.2'
- if: matrix.test && matrix.ghc != '9.10' && matrix.ghc != '9.12' && matrix.ghc != '9.14' && matrix.ghc != '9.10.2'
name: Test hls-splice-plugin
run: cabal test hls-splice-plugin-tests || cabal test hls-splice-plugin-tests
run: cabal test ${CABAL_ARGS} hls-splice-plugin-tests || cabal test ${CABAL_ARGS} hls-splice-plugin-tests

- if: matrix.test && matrix.ghc != '9.12'
- if: matrix.test && matrix.ghc != '9.12' && matrix.ghc != '9.14'
name: Test hls-stan-plugin
run: cabal test hls-stan-plugin-tests || cabal test hls-stan-plugin-tests
run: cabal test ${CABAL_ARGS} hls-stan-plugin-tests || cabal test ${CABAL_ARGS} hls-stan-plugin-tests

- if: matrix.test
- if: matrix.test && matrix.ghc != '9.14'
name: Test hls-stylish-haskell-plugin
run: cabal test hls-stylish-haskell-plugin-tests || cabal test hls-stylish-haskell-plugin-tests
run: cabal test ${CABAL_ARGS} hls-stylish-haskell-plugin-tests || cabal test ${CABAL_ARGS} hls-stylish-haskell-plugin-tests

- if: matrix.test
- if: matrix.test && matrix.ghc != '9.14'
name: Test hls-ormolu-plugin
run: cabal test hls-ormolu-plugin-tests || cabal test hls-ormolu-plugin-tests
run: cabal test ${CABAL_ARGS} hls-ormolu-plugin-tests || cabal test ${CABAL_ARGS} hls-ormolu-plugin-tests

- if: matrix.test
- if: matrix.test && matrix.ghc != '9.14'
name: Test hls-fourmolu-plugin
run: cabal test hls-fourmolu-plugin-tests || cabal test hls-fourmolu-plugin-tests
run: cabal test ${CABAL_ARGS} hls-fourmolu-plugin-tests || cabal test ${CABAL_ARGS} hls-fourmolu-plugin-tests

- if: matrix.test
name: Test hls-explicit-imports-plugin test suite
run: cabal test hls-explicit-imports-plugin-tests || cabal test hls-explicit-imports-plugin-tests
run: cabal test ${CABAL_ARGS} hls-explicit-imports-plugin-tests || cabal test ${CABAL_ARGS} hls-explicit-imports-plugin-tests

- if: matrix.test
name: Test hls-call-hierarchy-plugin test suite
run: cabal test hls-call-hierarchy-plugin-tests || cabal test hls-call-hierarchy-plugin-tests
run: cabal test ${CABAL_ARGS} hls-call-hierarchy-plugin-tests || cabal test ${CABAL_ARGS} hls-call-hierarchy-plugin-tests

- if: matrix.test && matrix.os != 'windows-latest'
name: Test hls-rename-plugin test suite
run: cabal test hls-rename-plugin-tests || cabal test hls-rename-plugin-tests
run: cabal test ${CABAL_ARGS} hls-rename-plugin-tests || cabal test ${CABAL_ARGS} hls-rename-plugin-tests

# TODO enable when it supports 9.10
- if: matrix.test && matrix.ghc != '9.10' && matrix.ghc != '9.10.2'
# Hlint will never work on GHC 9.10
- if: matrix.test && matrix.ghc != '9.10' && matrix.ghc != '9.14' && matrix.ghc != '9.10.2'
name: Test hls-hlint-plugin test suite
run: cabal test hls-hlint-plugin-tests || cabal test hls-hlint-plugin-tests
run: cabal test ${CABAL_ARGS} hls-hlint-plugin-tests || cabal test ${CABAL_ARGS} hls-hlint-plugin-tests

- if: matrix.test
name: Test hls-module-name-plugin test suite
run: cabal test hls-module-name-plugin-tests || cabal test hls-module-name-plugin-tests
run: cabal test ${CABAL_ARGS} hls-module-name-plugin-tests || cabal test ${CABAL_ARGS} hls-module-name-plugin-tests

- if: matrix.test
name: Test hls-alternate-number-format-plugin test suite
run: cabal test hls-alternate-number-format-plugin-tests || cabal test hls-alternate-number-format-plugin-tests
run: cabal test ${CABAL_ARGS} hls-alternate-number-format-plugin-tests || cabal test ${CABAL_ARGS} hls-alternate-number-format-plugin-tests

- if: matrix.test
name: Test hls-qualify-imported-names-plugin test suite
run: cabal test hls-qualify-imported-names-plugin-tests || cabal test hls-qualify-imported-names-plugin-tests
run: cabal test ${CABAL_ARGS} hls-qualify-imported-names-plugin-tests || cabal test ${CABAL_ARGS} hls-qualify-imported-names-plugin-tests

- if: matrix.test
name: Test hls-code-range-plugin test suite
run: cabal test hls-code-range-plugin-tests || cabal test hls-code-range-plugin-tests
run: cabal test ${CABAL_ARGS} hls-code-range-plugin-tests || cabal test ${CABAL_ARGS} hls-code-range-plugin-tests

- if: matrix.test
name: Test hls-change-type-signature test suite
run: cabal test hls-change-type-signature-plugin-tests || cabal test hls-change-type-signature-plugin-tests
run: cabal test ${CABAL_ARGS} hls-change-type-signature-plugin-tests || cabal test ${CABAL_ARGS} hls-change-type-signature-plugin-tests

- if: matrix.test
name: Test hls-gadt-plugin test suit
run: cabal test hls-gadt-plugin-tests || cabal test hls-gadt-plugin-tests
run: cabal test ${CABAL_ARGS} hls-gadt-plugin-tests || cabal test ${CABAL_ARGS} hls-gadt-plugin-tests

- if: matrix.test
name: Test hls-explicit-fixity-plugin test suite
run: cabal test hls-explicit-fixity-plugin-tests || cabal test hls-explicit-fixity-plugin-tests
run: cabal test ${CABAL_ARGS} hls-explicit-fixity-plugin-tests || cabal test ${CABAL_ARGS} hls-explicit-fixity-plugin-tests

- if: matrix.test
name: Test hls-explicit-record-fields-plugin test suite
run: cabal test hls-explicit-record-fields-plugin-tests || cabal test hls-explicit-record-fields-plugin-tests
run: cabal test ${CABAL_ARGS} hls-explicit-record-fields-plugin-tests || cabal test ${CABAL_ARGS} hls-explicit-record-fields-plugin-tests

# versions need to be limited since the tests depend on cabal-fmt which only builds with ghc <9.10
- if: matrix.test && matrix.ghc != '9.10' && matrix.ghc != '9.12' && matrix.ghc != '9.10.2'
- if: matrix.test && matrix.ghc != '9.10' && matrix.ghc != '9.12' && matrix.ghc != '9.14' && matrix.ghc != '9.10.2'
name: Test hls-cabal-fmt-plugin test suite
run: cabal test hls-cabal-fmt-plugin-tests --flag=isolateCabalfmtTests || cabal test hls-cabal-fmt-plugin-tests --flag=isolateCabalfmtTests
run: cabal test ${CABAL_ARGS} hls-cabal-fmt-plugin-tests --flag=isolateCabalfmtTests || cabal test ${CABAL_ARGS} hls-cabal-fmt-plugin-tests --flag=isolateCabalfmtTests

- if: matrix.test && matrix.ghc != '9.12'
- if: matrix.test && matrix.ghc != '9.12' && matrix.ghc != '9.14'
name: Test hls-cabal-gild-plugin test suite
run: cabal test hls-cabal-gild-plugin-tests --flag=isolateCabalGildTests || cabal test hls-cabal-gild-plugin-tests --flag=isolateCabalGildTests
run: cabal test ${CABAL_ARGS} hls-cabal-gild-plugin-tests --flag=isolateCabalGildTests || cabal test ${CABAL_ARGS} hls-cabal-gild-plugin-tests --flag=isolateCabalGildTests

- if: matrix.test
name: Test hls-cabal-plugin test suite
run: cabal test hls-cabal-plugin-tests || cabal test hls-cabal-plugin-tests
run: cabal test ${CABAL_ARGS} hls-cabal-plugin-tests || cabal test ${CABAL_ARGS} hls-cabal-plugin-tests

# TODO enable when it supports 9.10
- if: matrix.test && matrix.ghc != '9.10' && matrix.ghc != '9.12' && matrix.ghc != '9.10.2'
- if: matrix.test && matrix.ghc != '9.10' && matrix.ghc != '9.12' && matrix.ghc != '9.14' && matrix.ghc != '9.10.2'
name: Test hls-retrie-plugin test suite
run: cabal test hls-retrie-plugin-tests || cabal test hls-retrie-plugin-tests
run: cabal test ${CABAL_ARGS} hls-retrie-plugin-tests || cabal test ${CABAL_ARGS} hls-retrie-plugin-tests

- if: matrix.test
name: Test hls-overloaded-record-dot-plugin test suite
run: cabal test hls-overloaded-record-dot-plugin-tests || cabal test hls-overloaded-record-dot-plugin-tests
run: cabal test ${CABAL_ARGS} hls-overloaded-record-dot-plugin-tests || cabal test ${CABAL_ARGS} hls-overloaded-record-dot-plugin-tests

- if: matrix.test
name: Test hls-semantic-tokens-plugin test suite
run: cabal test hls-semantic-tokens-plugin-tests || cabal test hls-semantic-tokens-plugin-tests
run: cabal test ${CABAL_ARGS} hls-semantic-tokens-plugin-tests || cabal test ${CABAL_ARGS} hls-semantic-tokens-plugin-tests

- if: matrix.test
name: Test hls-notes-plugin test suite
run: cabal test hls-notes-plugin-tests || cabal test hls-notes-plugin-tests
run: cabal test ${CABAL_ARGS} hls-notes-plugin-tests || cabal test ${CABAL_ARGS} hls-notes-plugin-tests

# The plugin tutorial is only compatible with 9.6 and 9.8.
# No particular reason, just to avoid excessive CPP.
- if: matrix.test && matrix.ghc != '9.4' && matrix.ghc != '9.10' && matrix.ghc != '9.12' && matrix.ghc != '9.10.2'
- if: matrix.test && matrix.ghc != '9.4' && matrix.ghc != '9.10' && matrix.ghc != '9.12' && matrix.ghc != '9.14' && matrix.ghc != '9.10.2'
name: Compile the plugin-tutorial
run: cabal build plugin-tutorial
run: cabal build ${CABAL_ARGS} plugin-tutorial

- if: matrix.test
name: Test hls-signature-help-plugin test suite
run: cabal test hls-signature-help-plugin-tests || cabal test hls-signature-help-plugin-tests
run: cabal test ${CABAL_ARGS} hls-signature-help-plugin-tests || cabal test ${CABAL_ARGS} hls-signature-help-plugin-tests

test_post_job:
if: always()
Expand Down
85 changes: 84 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ packages:
./hls-test-utils


index-state: 2025-08-08T12:31:54Z
index-state: 2026-01-01T00:00:00Z

source-repository-package
type: git
location: https://github.com/snowleopard/alga
tag: d4e43fb42db05413459fb2df493361d5a666588a

tests: True
test-show-details: direct
Expand Down Expand Up @@ -56,3 +61,81 @@ if impl(ghc >= 9.11)
allow-newer:
cabal-install-parsers:base,
cabal-install-parsers:time,

if impl(ghc >= 9.14)
allow-newer:
scientific:containers,
lsp-types:containers,
lsp:containers,
indexed-traversable:containers,
foldl:containers,
deferred-folds:containers,
quickcheck-instances:containers,
hashable:containers,
dependent-map:containers,
aeson:containers,
semialign:containers,
lsp-test:containers,
haddock-library:base,
hiedb:ghc,
hie-bios:ghc,
integer-logarithms:ghc-bignum,
hashable:ghc-bignum,
string-interpolate:template-haskell,
haskell-src-meta:template-haskell,
th-orphans:template-haskell,
th-lift:template-haskell,
th-expand-syns:template-haskell,
tasty-hspec:base,
hsc2hs:base,
primitive:base,
tagged:template-haskell,
indexed-traversable:base,
text-short:base,
text-short:template-haskell,
bifunctors:template-haskell,
th-abstraction:template-haskell,
scientific:base,
integer-logarithms:base,
splitmix:base,
quickcheck-instances:base,
time-compat:base,
time-compat:time,
these:base,
assoc:base,
data-fix:base,
OneTuple:base,
some:base,
boring:base,
indexed-traversable-instances:base,
lsp-types:template-haskell,
uuid-types:template-haskell,
parallel:base,
lens:template-haskell,
free:template-haskell,
hiedb:base,
hie-compat:base,
hie-bios:time,
hie-bios:template-haskell,
hashable:base,
unordered-containers:template-haskell,
ghc-trace-events:base,
constraints-extras:template-haskell,
co-log-core:base,
async:base,
aeson:time,
text-iso8601:time,
semialign:base,
integer-conversion:base,
generically:base,
aeson:template-haskell,
scientific:template-haskell,
th-compat:template-haskell,
lsp-test:time,
ghc-lib-parser:base,
lukko:base,
binary-instances:base,
binary-orphans:base,
generic-deriving:template-haskell,
generic-deriving:containers,
cabal-install-parsers:containers,
5 changes: 4 additions & 1 deletion ghcide-test/data/multi/cabal.project
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
packages: a b c

allow-newer: base
allow-newer: async:base,
hashable:base,
hashable:template-haskell,
hashable:ghc-bignum,
4 changes: 2 additions & 2 deletions ghcide-test/exe/FindDefinitionAndHoverTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ tests = let
aaaL11 = Position 11 1 ; aaaType = [ExpectHoverTextRegex "Go to \\[TypeConstructor\\]\\(.*GotoHover\\.hs#L8\\)"]
dcL7 = Position 11 11 ; tcDC = [mkR 7 23 9 16]
dcL12 = Position 16 11 ;
xtcL5 = Position 9 11 ; xtc = [ExpectHoverText ["Int", "Defined in ", "GHC.Types", "ghc-prim"]]
xtcL5 = Position 9 11 ; xtc = [ExpectHoverText ["Int", "Defined in ", if ghcVersion >= GHC914 then "GHC.Internal.Types" else "GHC.Types", if ghcVersion >= GHC914 then "ghc-internal" else "ghc-prim"]]
tcL6 = Position 10 11 ; tcData = [mkR 7 0 9 16, ExpectHoverText ["TypeConstructor", "GotoHover.hs:8:1"]]
vvL16 = Position 20 12 ; vv = [mkR 20 4 20 6]
opL16 = Position 20 15 ; op = [mkR 21 2 21 4]
Expand Down Expand Up @@ -188,7 +188,7 @@ tests = let
innL48 = Position 52 5 ; innSig = [ExpectHoverText ["inner"], mkR 53 2 53 7]; innSig' = [ExpectHoverText ["inner", "Char"], mkR 49 2 49 7]
holeL60 = Position 62 7 ; hleInfo = [ExpectHoverText ["_ ::"]]
holeL65 = Position 65 8 ; hleInfo2 = [ExpectHoverText ["_ :: a -> Maybe a"]]
cccL17 = Position 17 16 ; docLink = [ExpectHoverTextRegex "\\*Defined in 'GHC.Types'\\* \\*\\(ghc-prim-[0-9.]+\\)\\*\n\n"]
cccL17 = Position 17 16 ; docLink = [ExpectHoverTextRegex $ if ghcVersion >= GHC914 then "\\*Defined in 'GHC.Internal.Types'\\* \\*\\(ghc-internal-[0-9.]+\\)\\*\n\n" else "\\*Defined in 'GHC.Types'\\* \\*\\(ghc-prim-[0-9.]+\\)\\*\n\n"]
imported = Position 56 13 ; importedSig = getDocUri "Foo.hs" >>= \foo -> return [ExpectHoverText ["foo", "Foo", "Haddock"], mkL foo 5 0 5 3]
reexported = Position 55 14
reexportedSig = getDocUri "Bar.hs" >>= \bar -> return [ExpectHoverText ["Bar", "Bar", "Haddock"], mkL bar 3 0 3 14]
Expand Down
5 changes: 5 additions & 0 deletions ghcide/session-loader/Development/IDE/Session.hs
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@
[] -> error $ "GHC version could not be parsed: " <> version
((runTime, _):_)
| compileTime == runTime -> do
atomicModifyIORef' cradle_files (\xs -> (cfp:xs,()))

Check warning on line 632 in ghcide/session-loader/Development/IDE/Session.hs

View workflow job for this annotation

GitHub Actions / Hlint check run

Warning in loadSessionWithOptions in module Development.IDE.Session: Use atomicModifyIORef'_ ▫︎ Found: "atomicModifyIORef' cradle_files (\\ xs -> (cfp : xs, ()))" ▫︎ Perhaps: "atomicModifyIORef'_ cradle_files ((:) cfp)"
session (hieYaml, toNormalizedFilePath' cfp, opts, libDir)
| otherwise -> return (([renderPackageSetupException cfp GhcVersionMismatch{..}], Nothing),[])
-- Failure case, either a cradle error or the none cradle
Expand Down Expand Up @@ -885,7 +885,12 @@
hscEnv' <- -- Set up a multi component session with the other units on GHC 9.4
Compat.initUnits dfs hsc_env

#if MIN_VERSION_ghc(9,13,0)
let closure_errs_raw = checkHomeUnitsClosed' (hsc_unit_env hscEnv') (hsc_all_home_unit_ids hscEnv')
closure_errs = concatMap (Compat.bagToList . Compat.getMessages) closure_errs_raw
#else
let closure_errs = maybeToList $ checkHomeUnitsClosed' (hsc_unit_env hscEnv') (hsc_all_home_unit_ids hscEnv')
#endif
closure_err_to_multi_err err =
ideErrorWithSource
(Just "cradle") (Just DiagnosticSeverity_Warning) _cfp
Expand All @@ -896,7 +901,7 @@
x <- map errMsgDiagnostic closure_errs
DriverHomePackagesNotClosed us <- pure x
pure us
isBad ci = (homeUnitId_ (componentDynFlags ci)) `OS.member` bad_units

Check warning on line 904 in ghcide/session-loader/Development/IDE/Session.hs

View workflow job for this annotation

GitHub Actions / Hlint check run

Suggestion in newComponentCache in module Development.IDE.Session: Redundant bracket ▫︎ Found: "(homeUnitId_ (componentDynFlags ci)) `OS.member` bad_units" ▫︎ Perhaps: "homeUnitId_ (componentDynFlags ci) `OS.member` bad_units"
-- Whenever we spin up a session on Linux, dynamically load libm.so.6
-- in. We need this in case the binary is statically linked, in which
-- case the interactive session will fail when trying to load
Expand Down
Loading
Loading