Skip to content

Commit

Permalink
patch eval-plugin for missing Monad constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
juhp committed Jun 14, 2023
1 parent 818069d commit c41d6c5
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
22 changes: 22 additions & 0 deletions 3648.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From 6df3a5841c51ebb92da0ebd58f0f107b11b3a90e Mon Sep 17 00:00:00 2001
From: Sander <hey@sandydoo.me>
Date: Mon, 12 Jun 2023 06:15:45 +0000
Subject: [PATCH] Add missing Monad constraint in eval plugin

---
plugins/hls-eval-plugin/src/Ide/Plugin/Eval/Parse/Comments.hs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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
index f3479fa42c..5a4d3f71b5 100644
--- a/plugins/hls-eval-plugin/src/Ide/Plugin/Eval/Parse/Comments.hs
+++ b/plugins/hls-eval-plugin/src/Ide/Plugin/Eval/Parse/Comments.hs
@@ -496,7 +496,7 @@ consume style =
Line -> (,) <$> takeRest <*> getPosition
Block {} -> manyTill_ anySingle (getPosition <* eob)

-getPosition :: (Ord v, TraversableStream s) => ParsecT v s m Position
+getPosition :: (Monad m, Ord v, TraversableStream s) => ParsecT v s m Position
getPosition = sourcePosToPosition <$> getSourcePos

-- | Parses example test line.
22 changes: 19 additions & 3 deletions haskell-language-server.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# generated by cabal-rpm-2.1.0 --standalone
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Haskell/

%global evalplugin hls-eval-plugin-2.0.0.0

#%%global ghc_name ghc9.4
%bcond_without compiler_default

Expand All @@ -21,17 +23,20 @@

Name: %{pkg_name}%{?ghc_name:-%{ghc_name}}
Version: 2.0.0.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: LSP server for GHC %{ghc_version}

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

# Begin cabal-rpm deps:
BuildRequires: ghc-rpm-macros
Expand Down Expand Up @@ -390,7 +395,7 @@ Please see the README on GitHub at

%prep
# Begin cabal-rpm setup:
%setup -q -n %{pkgver}
%setup -q -n %{pkgver} -a1
%patch -P0 -p1 -b .orig
%if %{undefined ghc_name}
%if 0%{?fedora} < 38
Expand All @@ -401,7 +406,10 @@ Please see the README on GitHub at
%patch -P1 -p1 -b .orig
%endif
%endif

(
cd %{evalplugin}
%patch -P2 -p3 -b .orig
)
# End cabal-rpm setup
cabal-tweak-flag dynamic False

Expand Down Expand Up @@ -436,6 +444,11 @@ cabal update
%build
# Begin cabal-rpm build:
# End cabal-rpm build
cat > cabal.project << EOF
packages:
./
./hls-eval-plugin-2.0.0.0
EOF


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


%changelog
* Tue Jun 13 2023 Jens Petersen <petersen@redhat.com> - 2.0.0.0-2
- upstream patch for eval plugin Monad constraint

* Sat May 20 2023 Jens Petersen <petersen@redhat.com> - 2.0.0.0-1
- https://hackage.haskell.org/package/haskell-language-server-2.0.0.0/changelog

Expand Down

0 comments on commit c41d6c5

Please sign in to comment.