Skip to content

Commit 9f9b8f7

Browse files
authored
Merge branch 'master' into batch-load-multi-read
2 parents c883a09 + cd42bcf commit 9f9b8f7

25 files changed

+1425
-95
lines changed

.github/workflows/bench.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ jobs:
127127
example: ['cabal', 'lsp-types']
128128

129129
steps:
130-
- uses: haskell-actions/[email protected].10
130+
- uses: haskell-actions/[email protected].11
131131
with:
132132
ghc-version : ${{ matrix.ghc }}
133133
cabal-version: ${{ matrix.cabal }}

.github/workflows/test.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ jobs:
164164
name: Test hls-stan-plugin
165165
run: cabal test hls-stan-plugin-tests || cabal test hls-stan-plugin-tests
166166

167-
# TODO enable when it supports 9.10
168-
- if: matrix.test && matrix.ghc != '9.10' && matrix.ghc != '9.12'
167+
- if: matrix.test
169168
name: Test hls-stylish-haskell-plugin
170169
run: cabal test hls-stylish-haskell-plugin-tests || cabal test hls-stylish-haskell-plugin-tests
171170

@@ -190,7 +189,7 @@ jobs:
190189
run: cabal test hls-rename-plugin-tests || cabal test hls-rename-plugin-tests
191190

192191
# TODO enable when it supports 9.10
193-
- if: matrix.test && matrix.ghc != '9.10' && matrix.ghc != '9.12'
192+
- if: matrix.test && matrix.ghc != '9.10'
194193
name: Test hls-hlint-plugin test suite
195194
run: cabal test hls-hlint-plugin-tests || cabal test hls-hlint-plugin-tests
196195

@@ -214,7 +213,7 @@ jobs:
214213
name: Test hls-change-type-signature test suite
215214
run: cabal test hls-change-type-signature-plugin-tests || cabal test hls-change-type-signature-plugin-tests
216215

217-
- if: matrix.test && matrix.ghc != '9.12'
216+
- if: matrix.test
218217
name: Test hls-gadt-plugin test suit
219218
run: cabal test hls-gadt-plugin-tests || cabal test hls-gadt-plugin-tests
220219

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ repos:
44
- hooks:
55
- entry: stylish-haskell --inplace
66
exclude: >-
7-
(^Setup.hs$|test/testdata/.*$|test/data/.*$|test/manual/lhs/.*$|^hie-compat/.*$|^plugins/hls-tactics-plugin/.*$|^ghcide/src/Development/IDE/GHC/Compat.hs$|^plugins/hls-refactor-plugin/src/Development/IDE/GHC/Compat/ExactPrint.hs$|^ghcide/src/Development/IDE/GHC/Compat/Core.hs$|^ghcide/src/Development/IDE/Spans/Pragmas.hs$|^ghcide/src/Development/IDE/LSP/Outline.hs$|^plugins/hls-splice-plugin/src/Ide/Plugin/Splice.hs$|^ghcide/src/Development/IDE/Core/Rules.hs$|^ghcide/src/Development/IDE/Core/Compile.hs$|^plugins/hls-refactor-plugin/src/Development/IDE/GHC/ExactPrint.hs$|^plugins/hls-refactor-plugin/src/Development/IDE/Plugin/CodeAction/ExactPrint.hs$)
7+
(^Setup.hs$|test/testdata/.*$|test/data/.*$|test/manual/lhs/.*$|^hie-compat/.*$|^plugins/hls-tactics-plugin/.*$|^ghcide/src/Development/IDE/GHC/Compat.hs$|^plugins/hls-refactor-plugin/src/Development/IDE/GHC/Compat/ExactPrint.hs$|^ghcide/src/Development/IDE/GHC/Compat/Core.hs$|^ghcide/src/Development/IDE/Spans/Pragmas.hs$|^ghcide/src/Development/IDE/LSP/Outline.hs$|^plugins/hls-splice-plugin/src/Ide/Plugin/Splice.hs$|^ghcide/src/Development/IDE/Core/Rules.hs$|^ghcide/src/Development/IDE/Core/Compile.hs$|^plugins/hls-refactor-plugin/src/Development/IDE/GHC/ExactPrint.hs$|^plugins/hls-refactor-plugin/src/Development/IDE/Plugin/CodeAction/ExactPrint.hs$|^plugins/hls-eval-plugin/src/Ide/Plugin/Eval/Handlers.hs$)
88
files: \.l?hs$
99
id: stylish-haskell
1010
language: system

cabal.project

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ packages:
88
./hls-test-utils
99

1010

11-
index-state: 2025-04-08T01:30:37Z
11+
index-state: 2025-04-19T07:34:07Z
1212

1313
tests: True
1414
test-show-details: direct
@@ -63,9 +63,6 @@ allow-older: hie-bios:optparse-applicative
6363
if impl(ghc >= 9.11)
6464
benchmarks: False
6565
allow-newer:
66-
hie-bios:ghc,
67-
ghc-trace-events:base,
68-
tasty-hspec:base,
6966
cabal-install-parsers:base,
7067
cabal-install-parsers:time,
7168

docs/features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ Shows the type signature for bindings without type signatures, and adds it with
346346

347347
Provided by: `hls-eval-plugin`
348348

349-
Evaluates code blocks in comments with a click. [Tutorial](https://github.com/haskell/haskell-language-server/blob/master/plugins/hls-eval-plugin/README.md).
349+
Evaluates code blocks in comments with a click. A code action is also provided. [Tutorial](https://github.com/haskell/haskell-language-server/blob/master/plugins/hls-eval-plugin/README.md).
350350

351351
![Eval Demo](../plugins/hls-eval-plugin/demo.gif)
352352

docs/support/ghc-version-support.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Support status (see the support policy below for more details):
1717

1818
| GHC version | Last supporting HLS version | Support status |
1919
| ------------ | ------------------------------------------------------------------------------------ | -------------- |
20-
| 9.12.2 | [latest](https://github.com/haskell/haskell-language-server/releases/latest) | basic support |
20+
| 9.12.2 | [latest](https://github.com/haskell/haskell-language-server/releases/latest) | full support |
2121
| 9.10.1 | [latest](https://github.com/haskell/haskell-language-server/releases/latest) | full support |
2222
| 9.8.4 | [latest](https://github.com/haskell/haskell-language-server/releases/latest) | full support |
2323
| 9.8.2 | [2.9.0.1](https://github.com/haskell/haskell-language-server/releases/tag/2.9.0.1) | deprecated |

docs/support/plugin-support.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ For example, a plugin to provide a formatter which has itself been abandoned has
4444
| `hls-code-range-plugin` | 1 | |
4545
| `hls-explicit-imports-plugin` | 1 | |
4646
| `hls-pragmas-plugin` | 1 | |
47-
| `hls-refactor-plugin` | 2 | 9.12.2 |
47+
| `hls-refactor-plugin` | 2 | |
4848
| `hls-alternate-number-format-plugin` | 2 | |
4949
| `hls-cabal-fmt-plugin` | 2 | |
5050
| `hls-cabal-gild-plugin` | 2 | |
@@ -54,14 +54,14 @@ For example, a plugin to provide a formatter which has itself been abandoned has
5454
| `hls-explicit-fixity-plugin` | 2 | |
5555
| `hls-explicit-record-fields-plugin` | 2 | |
5656
| `hls-fourmolu-plugin` | 2 | |
57-
| `hls-gadt-plugin` | 2 | 9.12.2 |
58-
| `hls-hlint-plugin` | 2 | 9.10.1, 9.12.2 |
57+
| `hls-gadt-plugin` | 2 | |
58+
| `hls-hlint-plugin` | 2 | 9.10.1 |
5959
| `hls-module-name-plugin` | 2 | |
6060
| `hls-notes-plugin` | 2 | |
6161
| `hls-qualify-imported-names-plugin` | 2 | |
6262
| `hls-ormolu-plugin` | 2 | |
6363
| `hls-rename-plugin` | 2 | |
64-
| `hls-stylish-haskell-plugin` | 2 | 9.10.1, 9.12.2 |
64+
| `hls-stylish-haskell-plugin` | 2 | |
6565
| `hls-overloaded-record-dot-plugin` | 2 | |
6666
| `hls-semantic-tokens-plugin` | 2 | |
6767
| `hls-floskell-plugin` | 3 | 9.10.1, 9.12.2 |

haskell-language-server.cabal

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,9 @@ library hls-eval-plugin
460460
hs-source-dirs: plugins/hls-eval-plugin/src
461461
other-modules:
462462
Ide.Plugin.Eval.Code
463-
Ide.Plugin.Eval.CodeLens
464463
Ide.Plugin.Eval.Config
465464
Ide.Plugin.Eval.GHC
465+
Ide.Plugin.Eval.Handlers
466466
Ide.Plugin.Eval.Parse.Comments
467467
Ide.Plugin.Eval.Parse.Option
468468
Ide.Plugin.Eval.Rules
@@ -703,14 +703,14 @@ flag hlint
703703
manual: True
704704

705705
common hlint
706-
if flag(hlint) && (impl(ghc < 9.10) || flag(ignore-plugins-ghc-bounds))
706+
if flag(hlint) && ((impl(ghc < 9.10) || impl(ghc > 9.11)) || flag(ignore-plugins-ghc-bounds))
707707
build-depends: haskell-language-server:hls-hlint-plugin
708708
cpp-options: -Dhls_hlint
709709

710710
library hls-hlint-plugin
711711
import: defaults, pedantic, warnings
712712
-- https://github.com/ndmitchell/hlint/pull/1594
713-
if !(flag(hlint)) || (impl(ghc > 9.10) && !flag(ignore-plugins-ghc-bounds))
713+
if !(flag(hlint)) || ((impl(ghc >= 9.10) && impl(ghc < 9.11)) && !flag(ignore-plugins-ghc-bounds))
714714
buildable: False
715715
exposed-modules: Ide.Plugin.Hlint
716716
hs-source-dirs: plugins/hls-hlint-plugin/src
@@ -722,7 +722,7 @@ library hls-hlint-plugin
722722
, filepath
723723
, ghcide == 2.10.0.0
724724
, hashable
725-
, hlint >= 3.5 && < 3.9
725+
, hlint >= 3.5 && < 3.11
726726
, hls-plugin-api == 2.10.0.0
727727
, lens
728728
, mtl
@@ -753,7 +753,7 @@ library hls-hlint-plugin
753753

754754
test-suite hls-hlint-plugin-tests
755755
import: defaults, pedantic, test-defaults, warnings
756-
if (!flag(hlint)) || (impl(ghc > 9.10) && !flag(ignore-plugins-ghc-bounds))
756+
if !flag(hlint) || ((impl(ghc >= 9.10) && impl(ghc < 9.11)) && !flag(ignore-plugins-ghc-bounds))
757757
buildable: False
758758
type: exitcode-stdio-1.0
759759
hs-source-dirs: plugins/hls-hlint-plugin/test
@@ -1208,13 +1208,13 @@ flag gadt
12081208
manual: True
12091209

12101210
common gadt
1211-
if flag(gadt) && (impl(ghc < 9.11) || flag(ignore-plugins-ghc-bounds))
1211+
if flag(gadt)
12121212
build-depends: haskell-language-server:hls-gadt-plugin
12131213
cpp-options: -Dhls_gadt
12141214

12151215
library hls-gadt-plugin
12161216
import: defaults, pedantic, warnings
1217-
if !flag(gadt) || (impl(ghc > 9.11) && !flag(ignore-plugins-ghc-bounds))
1217+
if !flag(gadt)
12181218
buildable: False
12191219
exposed-modules: Ide.Plugin.GADT
12201220
other-modules: Ide.Plugin.GHC
@@ -1238,7 +1238,7 @@ library hls-gadt-plugin
12381238

12391239
test-suite hls-gadt-plugin-tests
12401240
import: defaults, pedantic, test-defaults, warnings
1241-
if !flag(gadt) || (impl(ghc > 9.11) && !flag(ignore-plugins-ghc-bounds))
1241+
if !flag(gadt)
12421242
buildable: False
12431243
type: exitcode-stdio-1.0
12441244
hs-source-dirs: plugins/hls-gadt-plugin/test
@@ -1551,14 +1551,14 @@ flag stylishHaskell
15511551
manual: True
15521552

15531553
common stylishHaskell
1554-
if flag(stylishHaskell) && (impl(ghc < 9.10) || flag(ignore-plugins-ghc-bounds))
1554+
if flag(stylishHaskell)
15551555
build-depends: haskell-language-server:hls-stylish-haskell-plugin
15561556
cpp-options: -Dhls_stylishHaskell
15571557

15581558
library hls-stylish-haskell-plugin
15591559
import: defaults, pedantic, warnings
15601560
-- https://github.com/haskell/stylish-haskell/issues/479
1561-
if !(flag(stylishHaskell) && (impl(ghc < 9.10) || flag(ignore-plugins-ghc-bounds)))
1561+
if !flag(stylishHaskell)
15621562
buildable: False
15631563
exposed-modules: Ide.Plugin.StylishHaskell
15641564
hs-source-dirs: plugins/hls-stylish-haskell-plugin/src
@@ -1570,13 +1570,13 @@ library hls-stylish-haskell-plugin
15701570
, hls-plugin-api == 2.10.0.0
15711571
, lsp-types
15721572
, mtl
1573-
, stylish-haskell ^>=0.12 || ^>=0.13 || ^>=0.14
1573+
, stylish-haskell >=0.12 && <0.16
15741574
, text
15751575

15761576

15771577
test-suite hls-stylish-haskell-plugin-tests
15781578
import: defaults, pedantic, test-defaults, warnings
1579-
if !(flag(stylishHaskell) && (impl(ghc < 9.10) || flag(ignore-plugins-ghc-bounds)))
1579+
if !flag(stylishHaskell)
15801580
buildable: False
15811581
type: exitcode-stdio-1.0
15821582
hs-source-dirs: plugins/hls-stylish-haskell-plugin/test

plugins/hls-eval-plugin/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ A test is composed by a sequence of contiguous lines, the result of their evalua
4040
"CDAB"
4141
```
4242

43-
You execute a test by clicking on the _Evaluate_ code lens that appears above it (or _Refresh_, if the test has been run previously).
43+
You execute a test by clicking on the _Evaluate_ code lens that appears above it (or _Refresh_, if the test has been run previously). A code action is also provided.
4444

4545
All tests in the same comment block are executed together.
4646

plugins/hls-eval-plugin/src/Ide/Plugin/Eval.hs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ module Ide.Plugin.Eval (
1313

1414
import Development.IDE (IdeState)
1515
import Ide.Logger (Recorder, WithPriority)
16-
import qualified Ide.Plugin.Eval.CodeLens as CL
1716
import Ide.Plugin.Eval.Config
17+
import qualified Ide.Plugin.Eval.Handlers as Handlers
1818
import Ide.Plugin.Eval.Rules (rules)
1919
import qualified Ide.Plugin.Eval.Types as Eval
2020
import Ide.Types (ConfigDescriptor (..),
@@ -27,9 +27,12 @@ import Language.LSP.Protocol.Message
2727
-- |Plugin descriptor
2828
descriptor :: Recorder (WithPriority Eval.Log) -> PluginId -> PluginDescriptor IdeState
2929
descriptor recorder plId =
30-
(defaultPluginDescriptor plId "Provies a code lens to evaluate expressions in doctest comments")
31-
{ pluginHandlers = mkPluginHandler SMethod_TextDocumentCodeLens (CL.codeLens recorder)
32-
, pluginCommands = [CL.evalCommand recorder plId]
30+
(defaultPluginDescriptor plId "Provies code action and lens to evaluate expressions in doctest comments")
31+
{ pluginHandlers = mconcat
32+
[ mkPluginHandler SMethod_TextDocumentCodeAction (Handlers.codeAction recorder)
33+
, mkPluginHandler SMethod_TextDocumentCodeLens (Handlers.codeLens recorder)
34+
]
35+
, pluginCommands = [Handlers.evalCommand recorder plId]
3336
, pluginRules = rules recorder
3437
, pluginConfigDescriptor = defaultConfigDescriptor
3538
{ configCustomConfig = mkCustomConfig properties

0 commit comments

Comments
 (0)