diff --git a/rzk/package.yaml b/rzk/package.yaml index 61166bd44..bdcb2a71d 100644 --- a/rzk/package.yaml +++ b/rzk/package.yaml @@ -21,7 +21,7 @@ description: Please see the README on GitHub at - - Build with LSP support. + Build with LSP support (only available with GHC, not GHCJS). manual: true default: true @@ -31,21 +31,14 @@ build-tools: dependencies: array: ">= 0.5.3.0" - aeson: ">= 1.4.2.0" base: ">= 4.7 && < 5" bifunctors: ">= 5.5.3" bytestring: ">= 0.10.8.2" + Glob: ">= 0.9.3" mtl: ">= 2.2.2" + optparse-generic: ">= 1.3.0" template-haskell: ">= 2.14.0.0" text: ">= 1.2.3.1" - optparse-generic: ">= 1.3.0" - Glob: ">= 0.9.3" - lens: ">= 4.17" - filepath: ">= 1.4.2.1" - stm: ">= 2.5.0.0" - yaml: ">= 0.11.0.0" - data-default-class: ">= 0.1.2.0" - co-log-core: ">= 0.3.2.0" ghc-options: - -Wall @@ -73,9 +66,18 @@ library: - Language.Rzk.VSCode.Lsp - Language.Rzk.VSCode.State - Language.Rzk.VSCode.Tokenize + - Language.Rzk.VSCode.Logging dependencies: + aeson: ">= 1.4.2.0" + co-log-core: ">= 0.3.2.0" + data-default-class: ">= 0.1.2.0" + filepath: ">= 1.4.2.1" + lens: ">= 4.17" lsp: ">= 2.1.0.0" lsp-types: ">= 2.0.1.0" + stm: ">= 2.5.0.0" + yaml: ">= 0.11.0.0" + cpp-options: -DLSP executables: rzk: @@ -88,7 +90,7 @@ executables: dependencies: - rzk when: - - condition: flag(lsp) && !impl(ghcjs) + - condition: "!impl(ghcjs)" dependencies: with-utf8: ">= 1.0.2.4" diff --git a/rzk/rzk.cabal b/rzk/rzk.cabal index 8eabc58c7..86ba81808 100644 --- a/rzk/rzk.cabal +++ b/rzk/rzk.cabal @@ -26,7 +26,7 @@ source-repository head location: https://github.com/rzk-lang/rzk flag lsp - description: Build with LSP support. + description: Build with LSP support (only available with GHC, not GHCJS). manual: True default: True @@ -41,7 +41,6 @@ library Language.Rzk.Syntax.Lex Language.Rzk.Syntax.Par Language.Rzk.Syntax.Print - Language.Rzk.VSCode.Logging Rzk Rzk.Main Rzk.TypeCheck @@ -55,21 +54,14 @@ library , happy >=1.19.9 build-depends: Glob >=0.9.3 - , aeson >=1.4.2.0 , array >=0.5.3.0 , base >=4.7 && <5 , bifunctors >=5.5.3 , bytestring >=0.10.8.2 - , co-log-core >=0.3.2.0 - , data-default-class >=0.1.2.0 - , filepath >=1.4.2.1 - , lens >=4.17 , mtl >=2.2.2 , optparse-generic >=1.3.0 - , stm >=2.5.0.0 , template-haskell >=2.14.0.0 , text >=1.2.3.1 - , yaml >=0.11.0.0 default-language: Haskell2010 if flag(lsp) && !impl(ghcjs) exposed-modules: @@ -78,9 +70,18 @@ library Language.Rzk.VSCode.Lsp Language.Rzk.VSCode.State Language.Rzk.VSCode.Tokenize + Language.Rzk.VSCode.Logging + cpp-options: -DLSP build-depends: - lsp >=2.1.0.0 + aeson >=1.4.2.0 + , co-log-core >=0.3.2.0 + , data-default-class >=0.1.2.0 + , filepath >=1.4.2.1 + , lens >=4.17 + , lsp >=2.1.0.0 , lsp-types >=2.0.1.0 + , stm >=2.5.0.0 + , yaml >=0.11.0.0 executable rzk main-is: Main.hs @@ -94,24 +95,17 @@ executable rzk , happy >=1.19.9 build-depends: Glob >=0.9.3 - , aeson >=1.4.2.0 , array >=0.5.3.0 , base >=4.7 && <5 , bifunctors >=5.5.3 , bytestring >=0.10.8.2 - , co-log-core >=0.3.2.0 - , data-default-class >=0.1.2.0 - , filepath >=1.4.2.1 - , lens >=4.17 , mtl >=2.2.2 , optparse-generic >=1.3.0 , rzk - , stm >=2.5.0.0 , template-haskell >=2.14.0.0 , text >=1.2.3.1 - , yaml >=0.11.0.0 default-language: Haskell2010 - if flag(lsp) && !impl(ghcjs) + if !impl(ghcjs) build-depends: with-utf8 >=1.0.2.4 @@ -127,22 +121,15 @@ test-suite doctests build-depends: Glob , QuickCheck - , aeson >=1.4.2.0 , array >=0.5.3.0 , base , bifunctors >=5.5.3 , bytestring >=0.10.8.2 - , co-log-core >=0.3.2.0 - , data-default-class >=0.1.2.0 , doctest - , filepath >=1.4.2.1 - , lens >=4.17 , mtl >=2.2.2 , optparse-generic >=1.3.0 - , stm >=2.5.0.0 , template-haskell , text >=1.2.3.1 - , yaml >=0.11.0.0 default-language: Haskell2010 test-suite rzk-test @@ -158,20 +145,13 @@ test-suite rzk-test , happy >=1.19.9 build-depends: Glob >=0.9.3 - , aeson >=1.4.2.0 , array >=0.5.3.0 , base >=4.7 && <5 , bifunctors >=5.5.3 , bytestring >=0.10.8.2 - , co-log-core >=0.3.2.0 - , data-default-class >=0.1.2.0 - , filepath >=1.4.2.1 - , lens >=4.17 , mtl >=2.2.2 , optparse-generic >=1.3.0 , rzk - , stm >=2.5.0.0 , template-haskell >=2.14.0.0 , text >=1.2.3.1 - , yaml >=0.11.0.0 default-language: Haskell2010 diff --git a/rzk/rzk.nix b/rzk/rzk.nix index 08c937a42..9dab4b988 100644 --- a/rzk/rzk.nix +++ b/rzk/rzk.nix @@ -1,7 +1,6 @@ -{ mkDerivation, aeson, alex, array, base, bifunctors, bytestring -, data-default-class, doctest, filepath, Glob, happy, hpack, lens -, lib, mtl, optparse-generic, QuickCheck, stm, template-haskell -, text, yaml +{ mkDerivation, alex, array, base, bifunctors, bytestring, doctest +, Glob, happy, hpack, lib, mtl, optparse-generic, QuickCheck +, template-haskell, text }: mkDerivation { pname = "rzk"; @@ -10,19 +9,18 @@ mkDerivation { isLibrary = true; isExecutable = true; libraryHaskellDepends = [ - aeson array base bifunctors bytestring data-default-class filepath - Glob lens mtl optparse-generic stm template-haskell text yaml + array base bifunctors bytestring Glob mtl optparse-generic + template-haskell text ]; libraryToolDepends = [ alex happy hpack ]; executableHaskellDepends = [ - aeson array base bifunctors bytestring data-default-class filepath - Glob lens mtl optparse-generic stm template-haskell text yaml + array base bifunctors bytestring Glob mtl optparse-generic + template-haskell text ]; executableToolDepends = [ alex happy ]; testHaskellDepends = [ - aeson array base bifunctors bytestring data-default-class doctest - filepath Glob lens mtl optparse-generic QuickCheck stm - template-haskell text yaml + array base bifunctors bytestring doctest Glob mtl optparse-generic + QuickCheck template-haskell text ]; testToolDepends = [ alex happy ]; prePatch = "hpack"; diff --git a/rzk/src/Rzk/Main.hs b/rzk/src/Rzk/Main.hs index 187b40255..85474e57a 100644 --- a/rzk/src/Rzk/Main.hs +++ b/rzk/src/Rzk/Main.hs @@ -9,9 +9,11 @@ module Rzk.Main where import Control.Monad (forM, void) import Data.List (sort) import Data.Version (showVersion) -#ifndef __GHCJS__ + +#ifdef LSP import Language.Rzk.VSCode.Lsp (runLsp) #endif + import Options.Generic import System.Exit (exitFailure) import System.FilePath.Glob (glob) @@ -41,10 +43,10 @@ main = getRecord "rzk: an experimental proof assistant for synthetic ∞-categor Right _decls -> putStrLn "Everything is ok!" Lsp -> -#ifndef __GHCJS__ +#ifdef LSP void runLsp #else - error "rzk lsp is not supported with a GHCJS build" + error "rzk lsp is not supported with this build" #endif Version -> putStrLn (showVersion version) diff --git a/stack.yaml b/stack.yaml index 8ffec6992..0a9b75460 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,3 @@ resolver: snapshot.yaml packages: - rzk - \ No newline at end of file