Skip to content
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

Logging #114

Merged
merged 5 commits into from
Sep 30, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Move LSP dependencies under a condition, update CPP code
fizruk committed Sep 30, 2023

Verified

This commit was signed with the committer’s verified signature.
seunghwak Seunghwa Kang
commit 19ff8d58282094c3cb6fc43dfd4f432ddcbfb264
24 changes: 13 additions & 11 deletions rzk/package.yaml
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ description: Please see the README on GitHub at <https://github.com/rzk-lang/rzk
flags:
lsp:
description: >-
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"

44 changes: 12 additions & 32 deletions rzk/rzk.cabal
Original file line number Diff line number Diff line change
@@ -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
20 changes: 9 additions & 11 deletions rzk/rzk.nix
Original file line number Diff line number Diff line change
@@ -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";
8 changes: 5 additions & 3 deletions rzk/src/Rzk/Main.hs
Original file line number Diff line number Diff line change
@@ -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)
1 change: 0 additions & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
resolver: snapshot.yaml
packages:
- rzk