diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 35220f924..828f12ec8 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -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 @@ -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 @@ -34,6 +34,8 @@ jobs: ${{ runner.os }}-build- ${{ runner.os }}- + - name: Cabal update + run: cabal update - name: Build run: cabal build all - name: Test diff --git a/cabal.project b/cabal.project index e56cd6fdf..aa854048e 100644 --- a/cabal.project +++ b/cabal.project @@ -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 \ No newline at end of file +-- 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 diff --git a/lsp-test/func-test/func-test.cabal b/lsp-test/func-test/func-test.cabal index 9a6004a08..6de8229ee 100644 --- a/lsp-test/func-test/func-test.cabal +++ b/lsp-test/func-test/func-test.cabal @@ -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 diff --git a/lsp-test/lsp-test.cabal b/lsp-test/lsp-test.cabal index 900340a74..3b8ada544 100644 --- a/lsp-test/lsp-test.cabal +++ b/lsp-test/lsp-test.cabal @@ -5,7 +5,7 @@ description: A test framework for writing tests against . @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 , and . @@ -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 @@ -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 @@ -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 diff --git a/lsp-types/lsp-types.cabal b/lsp-types/lsp-types.cabal index 36a383c3e..550207436 100644 --- a/lsp-types/lsp-types.cabal +++ b/lsp-types/lsp-types.cabal @@ -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 diff --git a/lsp-types/src/Language/LSP/Types/Method.hs b/lsp-types/src/Language/LSP/Types/Method.hs index 89462f5a4..90897283c 100644 --- a/lsp-types/src/Language/LSP/Types/Method.hs +++ b/lsp-types/src/Language/LSP/Types/Method.hs @@ -312,7 +312,6 @@ instance A.FromJSON SomeServerMethod where parseJSON _ = fail "SomeServerMethod" -- instance FromJSON (SMethod m) -makeSingletonFromJSON 'SomeMethod ''SMethod -- --------------------------------------------------------------------- -- TO JSON @@ -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 diff --git a/lsp-types/src/Language/LSP/Types/TextDocument.hs b/lsp-types/src/Language/LSP/Types/TextDocument.hs index 465377a7a..b3d7d051b 100644 --- a/lsp-types/src/Language/LSP/Types/TextDocument.hs +++ b/lsp-types/src/Language/LSP/Types/TextDocument.hs @@ -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 -- ------------------------------------- @@ -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 @@ -234,7 +235,6 @@ deriveJSON lspOptions ''WillSaveTextDocumentParams -- ------------------------------------- -deriveJSON lspOptions ''SaveOptions makeExtendingDatatype "TextDocumentSaveRegistrationOptions" [''TextDocumentRegistrationOptions] diff --git a/lsp-types/src/Language/LSP/Types/WatchedFiles.hs b/lsp-types/src/Language/LSP/Types/WatchedFiles.hs index 74d265266..38a16bf6d 100644 --- a/lsp-types/src/Language/LSP/Types/WatchedFiles.hs +++ b/lsp-types/src/Language/LSP/Types/WatchedFiles.hs @@ -2,7 +2,7 @@ {-# LANGUAGE DuplicateRecordFields #-} module Language.LSP.Types.WatchedFiles where - + import Data.Aeson import Data.Aeson.TH import Data.Bits @@ -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. diff --git a/lsp/lsp.cabal b/lsp/lsp.cabal index fc32418ab..9869cfd8f 100644 --- a/lsp/lsp.cabal +++ b/lsp/lsp.cabal @@ -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 @@ -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