Skip to content

Add support for ghc 9.0.1 #312

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

Merged
merged 10 commits into from
Jun 19, 2021
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
6 changes: 4 additions & 2 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: ['8.10.4', '8.8.3', '8.6.5', '8.4.4']
ghc: ['9.0.1', '8.10.4', '8.8.3', '8.6.5', '8.4.4']
os: [ubuntu-latest, macOS-latest, windows-latest]
exclude:
- os: windows-latest
Expand All @@ -20,7 +20,7 @@ jobs:
- uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.2'
cabal-version: '3.4'

- name: Cache
uses: actions/cache@v1
Expand All @@ -34,6 +34,8 @@ jobs:
${{ runner.os }}-build-
${{ runner.os }}-

- name: Cabal update
run: cabal update
- name: Build
run: cabal build all
- name: Test
Expand Down
22 changes: 19 additions & 3 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,23 @@ benchmarks: True
test-show-details: direct
haddock-quickjump: True

constraints: some == 1.0.1,
dependent-sum == 0.7.1.0
allow-newer:
lens:template-haskell,
cryptohash-sha1:base,
cryptohash-md5:base,
hslogger:base,
entropy:Cabal,

max-backjumps: 10000
-- Required for ghc-9.0.1 support
source-repository-package
type: git
location: https://github.com/anka-213/th-extras
tag: 57a97b4df128eb7b360e8ab9c5759392de8d1659
-- https://github.com/mokus0/th-extras/pull/8

source-repository-package
type: git
location: https://github.com/anka-213/dependent-sum
tag: 8cf4c7fbc3bfa2be475a17bb7c94a1e1e9a830b5
subdir: dependent-sum-template
-- https://github.com/obsidiansystems/dependent-sum/pull/57
2 changes: 1 addition & 1 deletion lsp-test/func-test/func-test.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-type: Simple
test-suite func-test
main-is: FuncTest.hs
type: exitcode-stdio-1.0
build-depends: base <4.15
build-depends: base <4.16
, lsp-test
, lsp
, data-default
Expand Down
8 changes: 4 additions & 4 deletions lsp-test/lsp-test.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description:
A test framework for writing tests against
<https://microsoft.github.io/language-server-protocol/ Language Server Protocol servers>.
@Language.LSP.Test@ launches your server as a subprocess and allows you to simulate a session
down to the wire.
down to the wire.
To see examples of it in action, check out <https://github.com/haskell/haskell-ide-engine haskell-ide-engine>,
<https://github.com/haskell/haskell-language-server haskell-language-server> and
<https://github.com/digital-asset/ghcide ghcide>.
Expand Down Expand Up @@ -98,7 +98,7 @@ test-suite func-test
main-is: FuncTest.hs
hs-source-dirs: func-test
type: exitcode-stdio-1.0
build-depends: base <4.15
build-depends: base <4.16
, lsp-test
, lsp
, data-default
Expand All @@ -109,7 +109,7 @@ test-suite func-test
, async
default-language: Haskell2010

test-suite example
test-suite example
main-is: Test.hs
hs-source-dirs: example
type: exitcode-stdio-1.0
Expand All @@ -123,7 +123,7 @@ benchmark simple-bench
main-is: SimpleBench.hs
hs-source-dirs: bench
type: exitcode-stdio-1.0
build-depends: base <4.15
build-depends: base <4.16
, lsp-test
, lsp
, process
Expand Down
2 changes: 1 addition & 1 deletion lsp-types/lsp-types.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ library
, Language.LSP.Types.WorkspaceSymbol
-- other-extensions:
ghc-options: -Wall
build-depends: base >= 4.11 && < 4.15
build-depends: base >= 4.11 && < 4.16
, aeson >=1.2.2.0
, binary
, bytestring
Expand Down
3 changes: 2 additions & 1 deletion lsp-types/src/Language/LSP/Types/Method.hs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ instance A.FromJSON SomeServerMethod where
parseJSON _ = fail "SomeServerMethod"

-- instance FromJSON (SMethod m)
makeSingletonFromJSON 'SomeMethod ''SMethod

-- ---------------------------------------------------------------------
-- TO JSON
Expand Down Expand Up @@ -396,3 +395,5 @@ instance A.ToJSON (SMethod m) where
toJSON SCancelRequest = A.String "$/cancelRequest"
-- Custom
toJSON (SCustomMethod m) = A.String m

makeSingletonFromJSON 'SomeMethod ''SMethod
4 changes: 2 additions & 2 deletions lsp-types/src/Language/LSP/Types/TextDocument.hs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ data SaveOptions =
{ -- | The client is supposed to include the content on save.
_includeText :: Maybe Bool
} deriving (Show, Read, Eq)
deriveJSON lspOptions ''SaveOptions

-- -------------------------------------

Expand All @@ -107,7 +108,7 @@ instance FromJSON TextDocumentSyncKind where
parseJSON (Number 1) = pure TdSyncFull
parseJSON (Number 2) = pure TdSyncIncremental
parseJSON _ = fail "TextDocumentSyncKind"

data TextDocumentSyncOptions =
TextDocumentSyncOptions
{ -- | Open and close notifications are sent to the server. If omitted open
Expand Down Expand Up @@ -234,7 +235,6 @@ deriveJSON lspOptions ''WillSaveTextDocumentParams

-- -------------------------------------

deriveJSON lspOptions ''SaveOptions

makeExtendingDatatype "TextDocumentSaveRegistrationOptions"
[''TextDocumentRegistrationOptions]
Expand Down
5 changes: 2 additions & 3 deletions lsp-types/src/Language/LSP/Types/WatchedFiles.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{-# LANGUAGE DuplicateRecordFields #-}

module Language.LSP.Types.WatchedFiles where

import Data.Aeson
import Data.Aeson.TH
import Data.Bits
Expand Down Expand Up @@ -71,9 +71,8 @@ instance FromJSON WatchKind where
| otherwise = fail "WatchKind"
parseJSON _ = fail "WatchKind"

deriveJSON lspOptions ''DidChangeWatchedFilesRegistrationOptions
deriveJSON lspOptions ''FileSystemWatcher

deriveJSON lspOptions ''DidChangeWatchedFilesRegistrationOptions
-- | The file event type.
data FileChangeType = FcCreated -- ^ The file got created.
| FcChanged -- ^ The file got changed.
Expand Down
4 changes: 2 additions & 2 deletions lsp/lsp.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ library
, Language.LSP.Server.Control
, Language.LSP.Server.Processing
ghc-options: -Wall
build-depends: base >= 4.11 && < 4.15
build-depends: base >= 4.11 && < 4.16
, async
, aeson >=1.0.0.0
, attoparsec
Expand Down Expand Up @@ -69,7 +69,7 @@ executable lsp-demo-reactor-server
default-language: Haskell2010
ghc-options: -Wall -Wno-unticked-promoted-constructors

build-depends: base >= 4.11 && < 4.15
build-depends: base >= 4.11 && < 4.16
, aeson
, bytestring
, containers
Expand Down