Skip to content

Commit c41d6c5

Browse files
committed
patch eval-plugin for missing Monad constraint
haskell/haskell-language-server#3648
1 parent 818069d commit c41d6c5

File tree

2 files changed

+41
-3
lines changed

2 files changed

+41
-3
lines changed

3648.patch

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
From 6df3a5841c51ebb92da0ebd58f0f107b11b3a90e Mon Sep 17 00:00:00 2001
2+
From: Sander <hey@sandydoo.me>
3+
Date: Mon, 12 Jun 2023 06:15:45 +0000
4+
Subject: [PATCH] Add missing Monad constraint in eval plugin
5+
6+
---
7+
plugins/hls-eval-plugin/src/Ide/Plugin/Eval/Parse/Comments.hs | 2 +-
8+
1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+
diff --git a/plugins/hls-eval-plugin/src/Ide/Plugin/Eval/Parse/Comments.hs b/plugins/hls-eval-plugin/src/Ide/Plugin/Eval/Parse/Comments.hs
11+
index f3479fa42c..5a4d3f71b5 100644
12+
--- a/plugins/hls-eval-plugin/src/Ide/Plugin/Eval/Parse/Comments.hs
13+
+++ b/plugins/hls-eval-plugin/src/Ide/Plugin/Eval/Parse/Comments.hs
14+
@@ -496,7 +496,7 @@ consume style =
15+
Line -> (,) <$> takeRest <*> getPosition
16+
Block {} -> manyTill_ anySingle (getPosition <* eob)
17+
18+
-getPosition :: (Ord v, TraversableStream s) => ParsecT v s m Position
19+
+getPosition :: (Monad m, Ord v, TraversableStream s) => ParsecT v s m Position
20+
getPosition = sourcePosToPosition <$> getSourcePos
21+
22+
-- | Parses example test line.

haskell-language-server.spec

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# generated by cabal-rpm-2.1.0 --standalone
22
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Haskell/
33

4+
%global evalplugin hls-eval-plugin-2.0.0.0
5+
46
#%%global ghc_name ghc9.4
57
%bcond_without compiler_default
68

@@ -21,17 +23,20 @@
2123

2224
Name: %{pkg_name}%{?ghc_name:-%{ghc_name}}
2325
Version: 2.0.0.0
24-
Release: 1%{?dist}
26+
Release: 2%{?dist}
2527
Summary: LSP server for GHC %{ghc_version}
2628

2729
License: Apache-2.0
2830
Url: https://hackage.haskell.org/package/%{pkg_name}
2931
# Begin cabal-rpm sources:
3032
Source0: https://hackage.haskell.org/package/%{pkgver}/%{pkgver}.tar.gz
33+
Source1: https://hackage.haskell.org/package/%{evalplugin}/%{evalplugin}.tar.gz
3134
# End cabal-rpm sources
3235
Patch0: haskell-language-server-1.7.0.0-prettyprinter-1.7.patch
3336
# https://github.com/nikita-volkov/stm-hamt/issues/6
3437
Patch1: haskell-language-server-f37-stm-hamt.patch
38+
# https://github.com/haskell/haskell-language-server/pull/3648
39+
Patch2: https://patch-diff.githubusercontent.com/raw/haskell/haskell-language-server/pull/3648.patch
3540

3641
# Begin cabal-rpm deps:
3742
BuildRequires: ghc-rpm-macros
@@ -390,7 +395,7 @@ Please see the README on GitHub at
390395

391396
%prep
392397
# Begin cabal-rpm setup:
393-
%setup -q -n %{pkgver}
398+
%setup -q -n %{pkgver} -a1
394399
%patch -P0 -p1 -b .orig
395400
%if %{undefined ghc_name}
396401
%if 0%{?fedora} < 38
@@ -401,7 +406,10 @@ Please see the README on GitHub at
401406
%patch -P1 -p1 -b .orig
402407
%endif
403408
%endif
404-
409+
(
410+
cd %{evalplugin}
411+
%patch -P2 -p3 -b .orig
412+
)
405413
# End cabal-rpm setup
406414
cabal-tweak-flag dynamic False
407415

@@ -436,6 +444,11 @@ cabal update
436444
%build
437445
# Begin cabal-rpm build:
438446
# End cabal-rpm build
447+
cat > cabal.project << EOF
448+
packages:
449+
./
450+
./hls-eval-plugin-2.0.0.0
451+
EOF
439452

440453

441454
%install
@@ -471,6 +484,9 @@ rm %{buildroot}%{_bindir}/haskell-language-server-wrapper
471484

472485

473486
%changelog
487+
* Tue Jun 13 2023 Jens Petersen <petersen@redhat.com> - 2.0.0.0-2
488+
- upstream patch for eval plugin Monad constraint
489+
474490
* Sat May 20 2023 Jens Petersen <petersen@redhat.com> - 2.0.0.0-1
475491
- https://hackage.haskell.org/package/haskell-language-server-2.0.0.0/changelog
476492

0 commit comments

Comments
 (0)