Skip to content

Commit c5c8b12

Browse files
committed
Build with lsp-1.4 (stackage lts-19.33)
Preserve building with lsp-1.3 (stackate lts-18.28) in stack-8.10.yaml.
1 parent d6ab81d commit c5c8b12

File tree

6 files changed

+52
-51
lines changed

6 files changed

+52
-51
lines changed

agda-language-server.cabal

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

77
name: agda-language-server
8-
version: 0.2.1.0.2.2.6.2
8+
version: 0.2.2.0.2.2.6.2
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
@@ -20,8 +20,9 @@ build-type: Simple
2020
extra-source-files:
2121
README.md
2222
CHANGELOG.md
23-
stack.yaml
2423
package.yaml
24+
stack.yaml
25+
stack-8.10.yaml
2526

2627
source-repository head
2728
type: git
@@ -61,14 +62,15 @@ library
6162
default-extensions:
6263
LambdaCase
6364
OverloadedStrings
65+
TypeOperators
6466
ghc-options: -Wincomplete-patterns -Wunused-do-bind -Wunused-foralls -Wwarnings-deprecations -Wwrong-do-bind -Wmissing-fields -Wmissing-methods -Wmissing-pattern-synonym-signatures -Wmissing-signatures -Werror=incomplete-patterns -fno-warn-orphans
6567
build-depends:
6668
Agda ==2.6.2.2
6769
, aeson
6870
, base >=4.7 && <5
6971
, bytestring
7072
, containers
71-
, lsp <1.4
73+
, lsp <1.5
7274
, mtl
7375
, network
7476
, network-simple
@@ -84,6 +86,10 @@ executable als
8486
Paths_agda_language_server
8587
hs-source-dirs:
8688
app
89+
default-extensions:
90+
LambdaCase
91+
OverloadedStrings
92+
TypeOperators
8793
ghc-options: -Wincomplete-patterns -Wunused-do-bind -Wunused-foralls -Wwarnings-deprecations -Wwrong-do-bind -Wmissing-fields -Wmissing-methods -Wmissing-pattern-synonym-signatures -Wmissing-signatures -threaded -rtsopts -with-rtsopts=-N -Werror=incomplete-patterns -fno-warn-orphans
8894
build-depends:
8995
Agda ==2.6.2.2
@@ -92,7 +98,7 @@ executable als
9298
, base >=4.7 && <5
9399
, bytestring
94100
, containers
95-
, lsp <1.4
101+
, lsp <1.5
96102
, mtl
97103
, network
98104
, network-simple
@@ -139,14 +145,15 @@ test-suite als-test
139145
default-extensions:
140146
LambdaCase
141147
OverloadedStrings
148+
TypeOperators
142149
ghc-options: -Wincomplete-patterns -Wunused-do-bind -Wunused-foralls -Wwarnings-deprecations -Wwrong-do-bind -Wmissing-fields -Wmissing-methods -Wmissing-pattern-synonym-signatures -Wmissing-signatures -threaded -rtsopts -with-rtsopts=-N -Werror=incomplete-patterns -fno-warn-orphans
143150
build-depends:
144151
Agda ==2.6.2.2
145152
, aeson
146153
, base >=4.7 && <5
147154
, bytestring
148155
, containers
149-
, lsp <1.4
156+
, lsp <1.5
150157
, mtl
151158
, network
152159
, network-simple

package.yaml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: agda-language-server
2-
version: 0.2.1.0.2.2.6.2
2+
version: 0.2.2.0.2.2.6.2
33
github: "banacorn/agda-language-server"
44
license: MIT
55
author: "Ting-Gian LUA"
@@ -9,8 +9,9 @@ copyright: "2020 Author name here :)"
99
extra-source-files:
1010
- README.md
1111
- CHANGELOG.md
12-
- stack.yaml
1312
- package.yaml
13+
- stack.yaml
14+
- stack-8.10.yaml
1415

1516
# Metadata used when publishing your package
1617
synopsis: An implementation of language server protocal (LSP) for Agda 2.
@@ -21,13 +22,18 @@ category: Development
2122
# common to point users to the README.md file.
2223
description: Please see the README on GitHub at <https://github.com/agda/agda-language-server#readme>
2324

25+
default-extensions:
26+
- LambdaCase
27+
- OverloadedStrings
28+
- TypeOperators
29+
2430
dependencies:
2531
- base >= 4.7 && < 5
2632
- Agda == 2.6.2.2
2733
- aeson
2834
- bytestring
2935
- containers
30-
- lsp < 1.4
36+
- lsp < 1.5
3137
- mtl
3238
- network
3339
- network-simple
@@ -50,9 +56,6 @@ library:
5056
- -Wmissing-signatures
5157
- -Werror=incomplete-patterns
5258
- -fno-warn-orphans
53-
default-extensions:
54-
- LambdaCase
55-
- OverloadedStrings
5659

5760
executables:
5861
als:
@@ -104,10 +107,6 @@ tests:
104107
- -Werror=incomplete-patterns
105108
- -fno-warn-orphans
106109

107-
default-extensions:
108-
- LambdaCase
109-
- OverloadedStrings
110-
111110
# tests:
112111
# als-test:
113112
# main: Spec.hs

src/Agda/Position.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ toAgdaRange table path (LSP.Range start end) = Range
4242
toAgdaPositionWithoutFile :: ToOffset -> LSP.Position -> PositionWithoutFile
4343
toAgdaPositionWithoutFile table (LSP.Position line col) = Pn
4444
()
45-
(fromIntegral (toOffset table (line, col)) + 1)
45+
(fromIntegral (toOffset table (fromIntegral line, fromIntegral col)) + 1)
4646
(fromIntegral line + 1)
4747
(fromIntegral col + 1)
4848

@@ -55,7 +55,7 @@ prettyPositionWithoutFile pos@(Pn () offset _line _col) =
5555

5656
-- Keeps record of offsets of every line break ("\n", "\r" and "\r\n")
5757
--
58-
-- Example text corresponding entry of IntMap
58+
-- Example text corresponding entry of IntMap
5959
-- >abc\n (1, 4)
6060
-- >def123\r\n (2, 11)
6161
-- >ghi\r (3, 15)
@@ -97,7 +97,7 @@ toOffset (ToOffset table) (line, col) = case IntMap.lookup line table of
9797
-- An IntMap for speeding up Offset => Position convertion
9898
-- Keeps record of offsets of every line break ("\n", "\r" and "\r\n")
9999
--
100-
-- Example text corresponding entry of IntMap
100+
-- Example text corresponding entry of IntMap
101101
-- >abc\n (4, 1)
102102
-- >def123\r\n (11, 2)
103103
-- >ghi\r (15, 3)
@@ -115,11 +115,11 @@ makeFromOffset = FromOffset . accumResult . Text.foldl'
115115
(Accum Nothing 0 0 IntMap.empty)
116116
where
117117
go :: Accum -> Char -> Accum
118-
-- encountered a "\r\n", update the latest entry
118+
-- encountered a "\r\n", update the latest entry
119119
go (Accum (Just '\r') n l table) '\n' = case IntMap.deleteFindMax table of
120120
((offset, lineNo), table') ->
121121
Accum (Just '\n') (1 + n) l (IntMap.insert (1 + offset) lineNo table')
122-
-- encountered a line break, add a new entry
122+
-- encountered a line break, add a new entry
123123
go (Accum previous n l table) '\n' =
124124
Accum (Just '\n') (1 + n) (1 + l) (IntMap.insert (1 + n) (1 + l) table)
125125
go (Accum previous n l table) '\r' =

stack-8.10.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
resolver: lts-18.28
2+
compiler: ghc-8.10.7
3+
# Allow a newer minor version of GHC than the snapshot specifies
4+
compiler-check: newer-minor
5+
6+
packages:
7+
- .
8+
9+
# Use some newer versions than in the lts-18.28 snapshot
10+
extra-deps:
11+
- Agda-2.6.2.2
12+
- text-icu-0.8.0.1
13+
- lsp-1.2.0.1
14+
- lsp-types-1.3.0.1
15+
16+
flags:
17+
Agda:
18+
# optimise-heavily: true
19+
enable-cluster-counting: true

stack.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
resolver: lts-18.28
2-
compiler: ghc-8.10.7
1+
resolver: lts-19.33
2+
compiler: ghc-9.0.2
33
# Allow a newer minor version of GHC than the snapshot specifies
44
compiler-check: newer-minor
55

66
packages:
77
- .
88

9-
# Use some newer versions than in the lts-18.28 snapshot
9+
# Use some newer versions than in the lts-19.33 snapshot
1010
extra-deps:
11-
- Agda-2.6.2.2
1211
- text-icu-0.8.0.1
13-
- lsp-1.2.0.1
14-
- lsp-types-1.3.0.1
1512

1613
flags:
1714
Agda:

stack.yaml.lock

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,16 @@
44
# https://docs.haskellstack.org/en/stable/lock_files
55

66
packages:
7-
- completed:
8-
hackage: Agda-2.6.2.2@sha256:b69c2f317db2886cb387134af00a3e42a06fab6422686938797924d034255a55,37047
9-
pantry-tree:
10-
sha256: 2f868d8f70a0f6bdbe96eff66ba1ec7a76b398cfc44dc57be525d7a67a44c9ab
11-
size: 40002
12-
original:
13-
hackage: Agda-2.6.2.2
147
- completed:
158
hackage: text-icu-0.8.0.1@sha256:22d21c91e7a81f1ee5766b3406f4fe9df0ff8cc426581a861de3f6f2fa413449,4624
169
pantry-tree:
1710
sha256: 71ed32ecdce71adba6df6220e717b8ec4bd252cc403714c5c4ba70cf6d1aa1e4
1811
size: 3223
1912
original:
2013
hackage: text-icu-0.8.0.1
21-
- completed:
22-
hackage: lsp-1.2.0.1@sha256:4f037bbcdf2489a6a33351de1bf0cd89f94ad33a90338db4191ba34b3776af4e,5634
23-
pantry-tree:
24-
sha256: aecba0d6f2cfaeebae2053ebba6bb9f14d3edf732fdeea12e19bf4262f19ca18
25-
size: 1417
26-
original:
27-
hackage: lsp-1.2.0.1
28-
- completed:
29-
hackage: lsp-types-1.3.0.1@sha256:e7bd6261f0560fbbcce6c35a2ceb9cd10034896367e1c73973a4a2d85d322b0c,4689
30-
pantry-tree:
31-
sha256: 11c9725e4ae4cbc0126d19c728ef13a8b2930faa65802def47f14c94eabc334d
32-
size: 4146
33-
original:
34-
hackage: lsp-types-1.3.0.1
3514
snapshots:
3615
- completed:
37-
sha256: 428ec8d5ce932190d3cbe266b9eb3c175cd81e984babf876b64019e2cbe4ea68
38-
size: 590100
39-
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/28.yaml
40-
original: lts-18.28
16+
sha256: 6d1532d40621957a25bad5195bfca7938e8a06d923c91bc52aa0f3c41181f2d4
17+
size: 619204
18+
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/33.yaml
19+
original: lts-19.33

0 commit comments

Comments
 (0)