Skip to content

Commit ccfa2a3

Browse files
committed
v0.2.6.4.0: Build with and embed Agda-2.6.4
1 parent da1d928 commit ccfa2a3

File tree

15 files changed

+243
-42
lines changed

15 files changed

+243
-42
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

7+
## v0.2.6.4.0 - unreleased
8+
9+
### Changed
10+
- Embed Agda-2.6.4.
11+
- Builds with `lsp` < 1.7 on GHC 9.2 (LTS 20.26),
12+
and with Cabal also on 9.4 and 9.6.
13+
14+
### Added
15+
- Build flag `Agda-2-6-3` to embed Agda-2.6.3 rather than 2.6.4.
16+
17+
718
## v0.2.6.3.0 - 2023-11-23
819

920
### Changed
@@ -14,13 +25,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1425
### Added
1526
- Build flag `Agda-2-6-2-2` to embed Agda-2.6.2.2 rather than 2.6.3.
1627

28+
1729
## v0.2.6.2.2.1 - 2023-11-21
1830

1931
### Added
2032

2133
- Building with `lsp-1.6`.
2234
Builds with `lsp` < 1.7 on GHC 8.10 (LTS 18.28), 9.0 (LTS 19.33), and 9.2 (LTS 20.26).
2335

36+
2437
## v0.2.6.2.2 - 2023-11-21
2538

2639
### Changed
@@ -29,25 +42,30 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
2942
- Versioning scheme: _x.a.b.c.d.y_ where _a.b.c.d_ is the 4-digit Agda version (2.6.2.2), _x_ is 0 but may be bumped for revolutionary changes to the agda-language-server, and _y_ is for patch releases.
3043
- Builds with `lsp` < 1.5 on GHC 8.10 (LTS 18.28) and 9.0 (LTS 19.33).
3144

45+
3246
## v0.2.1 - 2021-10-25
3347

3448
No changes.
3549

50+
3651
## v0.2.0 - 2021-10-22
3752

3853
### Fixed
3954
- #2: Allow user to supply command-line options via agda-mode
4055

56+
4157
## v0.1.4 - 2021-10-04
4258

4359
### Fixed
4460
- Resume sending HighlightingInfos to agda-mode
4561

62+
4663
## v0.1.3 - 2021-10-04
4764

4865
### Fixed
4966
- Include DLLs in the bundle
5067

68+
5169
## v0.1.2 - 2021-10-03
5270

5371
### Fixed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ stack install
2121

2222
## Versioning
2323

24-
The version is _x.y.z.w.a.b.c.d_ where _x.y.z.w_ is the version of the Agda Language Server and _a.b.c.d_ the version of Agda it embeds.
25-
It follows the Haskell PVP (package versioning policy).
24+
The version is _x.a.b.c.d.y_ where _a.b.c.d_ is the 4-digit Agda version (2.6.4.0), _x_ is 0 but may be bumped for revolutionary changes to the agda-language-server, and _y_ is for patch releases.
2625

2726
## Why make it standalone?
2827

agda-language-server.cabal

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ cabal-version: 1.12
55
-- see: https://github.com/sol/hpack
66

77
name: agda-language-server
8-
version: 0.2.6.3.0
8+
version: 0.2.6.4.0
99
synopsis: An implementation of language server protocal (LSP) for Agda 2.
1010
description: Please see the README on GitHub at <https://github.com/agda/agda-language-server#readme>
1111
category: Development
1212
homepage: https://github.com/banacorn/agda-language-server#readme
1313
bug-reports: https://github.com/banacorn/agda-language-server/issues
1414
author: Ting-Gian LUA
15-
maintainer: [email protected]
16-
copyright: 2020 Author name here :)
15+
maintainer: [email protected], Andreas Abel
16+
copyright: 2020-23 Ting-Gian LUA, Andreas ABEL
1717
license: MIT
1818
license-file: LICENSE
1919
build-type: Simple
@@ -25,13 +25,19 @@ extra-source-files:
2525
stack-8.10-Agda-2.6.2.2.yaml
2626
stack-9.0-Agda-2.6.2.2.yaml
2727
stack-9.2-Agda-2.6.2.2.yaml
28+
stack-9.2-Agda-2.6.3.yaml
2829

2930
source-repository head
3031
type: git
3132
location: https://github.com/banacorn/agda-language-server
3233

3334
flag Agda-2-6-2-2
34-
description: Embed Agda-2.6.2.2 (rather than 2.6.3)
35+
description: Embed Agda-2.6.2.2 (rather than 2.6.4)
36+
manual: True
37+
default: False
38+
39+
flag Agda-2-6-3
40+
description: Embed Agda-2.6.3 (rather than 2.6.4)
3541
manual: True
3642
default: False
3743

@@ -77,21 +83,29 @@ library
7783
, base >=4.7 && <5
7884
, bytestring
7985
, containers
80-
, lsp <1.7
86+
, lsp <2
87+
, lsp-types <2
8188
, mtl
8289
, network
8390
, network-simple
91+
, prettyprinter
8492
, process
8593
, stm
8694
, strict
8795
, text
8896
default-language: Haskell2010
89-
if flag(Agda-2-6-2-2)
97+
if flag(Agda-2-6-2-2) && !flag(Agda-2-6-3)
9098
build-depends:
9199
Agda ==2.6.2.2
92-
else
100+
if !flag(Agda-2-6-2-2) && flag(Agda-2-6-3)
93101
build-depends:
94102
Agda ==2.6.3
103+
if !flag(Agda-2-6-2-2) && !flag(Agda-2-6-3)
104+
build-depends:
105+
Agda ==2.6.4
106+
if flag(Agda-2-6-2-2) && flag(Agda-2-6-3)
107+
build-depends:
108+
Agda <0
95109

96110
executable als
97111
main-is: Main.hs
@@ -111,21 +125,29 @@ executable als
111125
, base >=4.7 && <5
112126
, bytestring
113127
, containers
114-
, lsp <1.7
128+
, lsp <2
129+
, lsp-types <2
115130
, mtl
116131
, network
117132
, network-simple
133+
, prettyprinter
118134
, process
119135
, stm
120136
, strict
121137
, text
122138
default-language: Haskell2010
123-
if flag(Agda-2-6-2-2)
139+
if flag(Agda-2-6-2-2) && !flag(Agda-2-6-3)
124140
build-depends:
125141
Agda ==2.6.2.2
126-
else
142+
if !flag(Agda-2-6-2-2) && flag(Agda-2-6-3)
127143
build-depends:
128144
Agda ==2.6.3
145+
if !flag(Agda-2-6-2-2) && !flag(Agda-2-6-3)
146+
build-depends:
147+
Agda ==2.6.4
148+
if flag(Agda-2-6-2-2) && flag(Agda-2-6-3)
149+
build-depends:
150+
Agda <0
129151

130152
test-suite als-test
131153
type: exitcode-stdio-1.0
@@ -172,10 +194,12 @@ test-suite als-test
172194
, base >=4.7 && <5
173195
, bytestring
174196
, containers
175-
, lsp <1.7
197+
, lsp <2
198+
, lsp-types <2
176199
, mtl
177200
, network
178201
, network-simple
202+
, prettyprinter
179203
, process
180204
, stm
181205
, strict
@@ -185,9 +209,15 @@ test-suite als-test
185209
, tasty-quickcheck
186210
, text
187211
default-language: Haskell2010
188-
if flag(Agda-2-6-2-2)
212+
if flag(Agda-2-6-2-2) && !flag(Agda-2-6-3)
189213
build-depends:
190214
Agda ==2.6.2.2
191-
else
215+
if !flag(Agda-2-6-2-2) && flag(Agda-2-6-3)
192216
build-depends:
193217
Agda ==2.6.3
218+
if !flag(Agda-2-6-2-2) && !flag(Agda-2-6-3)
219+
build-depends:
220+
Agda ==2.6.4
221+
if flag(Agda-2-6-2-2) && flag(Agda-2-6-3)
222+
build-depends:
223+
Agda <0

package.yaml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: agda-language-server
2-
version: 0.2.6.3.0
2+
version: 0.2.6.4.0
33
github: "banacorn/agda-language-server"
44
license: MIT
55
author: "Ting-Gian LUA"
6-
maintainer: "[email protected]"
7-
copyright: "2020 Author name here :)"
6+
maintainer: "[email protected], Andreas Abel"
7+
copyright: "2020-23 Ting-Gian LUA, Andreas ABEL"
88

99
extra-source-files:
1010
- README.md
@@ -14,6 +14,7 @@ extra-source-files:
1414
- stack-8.10-Agda-2.6.2.2.yaml
1515
- stack-9.0-Agda-2.6.2.2.yaml
1616
- stack-9.2-Agda-2.6.2.2.yaml
17+
- stack-9.2-Agda-2.6.3.yaml
1718

1819
# Metadata used when publishing your package
1920
synopsis: An implementation of language server protocal (LSP) for Agda 2.
@@ -26,33 +27,44 @@ description: Please see the README on GitHub at <https://github.com/agda
2627

2728
flags:
2829
Agda-2-6-2-2:
29-
description: Embed Agda-2.6.2.2 (rather than 2.6.3)
30+
description: Embed Agda-2.6.2.2 (rather than 2.6.4)
31+
manual: true
32+
default: false
33+
Agda-2-6-3:
34+
description: Embed Agda-2.6.3 (rather than 2.6.4)
3035
manual: true
3136
default: false
3237

3338
when:
34-
- condition: flag(Agda-2-6-2-2)
35-
then:
36-
dependencies:
39+
- condition: "flag(Agda-2-6-2-2) && !flag(Agda-2-6-3)"
40+
dependencies:
3741
- Agda == 2.6.2.2
38-
else:
39-
dependencies:
42+
- condition: "!flag(Agda-2-6-2-2) && flag(Agda-2-6-3)"
43+
dependencies:
4044
- Agda == 2.6.3
45+
- condition: "!flag(Agda-2-6-2-2) && !flag(Agda-2-6-3)"
46+
dependencies:
47+
- Agda == 2.6.4
48+
- condition: "flag(Agda-2-6-2-2) && flag(Agda-2-6-3)"
49+
dependencies:
50+
- Agda < 0
4151

4252
dependencies:
4353
- base >= 4.7 && < 5
4454
- Agda
4555
- aeson
4656
- bytestring
4757
- containers
48-
- lsp < 1.7
58+
- lsp-types < 2
59+
- lsp < 2
4960
- mtl
5061
- network
5162
- network-simple
5263
- strict
5364
- stm
5465
- text
5566
- process
67+
- prettyprinter
5668

5769
default-extensions:
5870
- LambdaCase

src/Agda.hs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ module Agda
1010
, getCommandLineOptions
1111
) where
1212

13+
import Prelude hiding ( null )
14+
1315
import Agda.Compiler.Backend ( parseBackendOptions )
1416
import Agda.Compiler.Builtin ( builtinBackends )
1517
import Agda.Convert ( fromResponse )
@@ -23,6 +25,9 @@ import Agda.Interaction.Base ( Command
2325
, parseIOTCM
2426
#endif
2527
)
28+
#if MIN_VERSION_Agda(2,6,4)
29+
import Agda.Syntax.Common.Pretty ( render, vcat )
30+
#endif
2631
import Agda.Interaction.InteractionTop
2732
( initialiseCommandQueue
2833
, maybeAbort
@@ -53,6 +58,7 @@ import Agda.Utils.Impossible ( CatchImpossible
5358
)
5459
, Impossible
5560
)
61+
import Agda.Utils.Null ( null )
5662
import Agda.VersionCommit ( versionWithCommitInfo )
5763
import Control.Exception ( SomeException
5864
, catch
@@ -218,7 +224,11 @@ runAgda p = do
218224
s2s <- prettyTCWarnings' =<< getAllWarningsOfTCErr err
219225
s1 <- prettyError err
220226
let ss = filter (not . null) $ s2s ++ [s1]
227+
#if MIN_VERSION_Agda(2,6,4)
228+
let errorMsg = render $ vcat ss
229+
#else
221230
let errorMsg = unlines ss
231+
#endif
222232
return (Left errorMsg)
223233

224234
handleImpossible :: Impossible -> TCM (Either String a)

src/Agda/Convert.hs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@ import Agda.Utils.IO.TempFile (writeToTempFile)
3838
import Agda.Utils.Impossible (__IMPOSSIBLE__)
3939
import Agda.Utils.Maybe (catMaybes)
4040
import Agda.Utils.Null (empty)
41+
#if MIN_VERSION_Agda(2,6,4)
42+
import Agda.Syntax.Common.Pretty hiding (render)
43+
-- import Prettyprinter hiding (Doc)
44+
import qualified Prettyprinter
45+
#else
4146
import Agda.Utils.Pretty hiding (render)
47+
#endif
4248
import Agda.Utils.RangeMap ( IsBasicRangeMap(toList) )
4349
import Agda.Utils.String (delimiter)
4450
import Agda.Utils.Time (CPUTime)
@@ -306,7 +312,12 @@ lispifyGoalSpecificDisplayInfo ii kind = localTCState $
306312

307313
auxSect <- case aux of
308314
GoalOnly -> return []
315+
#if MIN_VERSION_Agda(2,6,4)
316+
GoalAndHave expr bndry -> do
317+
-- TODO: render bndry
318+
#else
309319
GoalAndHave expr -> do
320+
#endif
310321
rendered <- renderATop expr
311322
raw <- show <$> prettyATop expr
312323
return [Labeled rendered (Just raw) Nothing "Have" "special"]
@@ -456,7 +467,11 @@ prettyResponseContext ::
456467
ResponseContextEntry ->
457468
TCM [(String, Doc)]
458469
prettyResponseContext ii (ResponseContextEntry n x (Arg ai expr) letv nis) = withInteractionId ii $ do
470+
#if MIN_VERSION_Agda(2,6,4)
471+
modality <- currentModality
472+
#else
459473
modality <- asksTC getModality
474+
#endif
460475
do
461476
let prettyCtxName :: String
462477
prettyCtxName
@@ -505,7 +520,11 @@ renderResponseContext ::
505520
ResponseContextEntry ->
506521
TCM [Block]
507522
renderResponseContext ii (ResponseContextEntry n x (Arg ai expr) letv nis) = withInteractionId ii $ do
523+
#if MIN_VERSION_Agda(2,6,4)
524+
modality <- currentModality
525+
#else
508526
modality <- asksTC getModality
527+
#endif
509528
do
510529
let
511530
rawCtxName :: String

0 commit comments

Comments
 (0)