Skip to content

Commit

Permalink
Build with lsp-1.4 (stackage lts-19.33)
Browse files Browse the repository at this point in the history
Preserve building with lsp-1.3 (stackate lts-18.28) in stack-8.10.yaml.
  • Loading branch information
andreasabel committed Nov 20, 2023
1 parent d6ab81d commit c5c8b12
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 51 deletions.
17 changes: 12 additions & 5 deletions agda-language-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cabal-version: 1.12
-- see: https://github.com/sol/hpack

name: agda-language-server
version: 0.2.1.0.2.2.6.2
version: 0.2.2.0.2.2.6.2
synopsis: An implementation of language server protocal (LSP) for Agda 2.
description: Please see the README on GitHub at <https://github.com/agda/agda-language-server#readme>
category: Development
Expand All @@ -20,8 +20,9 @@ build-type: Simple
extra-source-files:
README.md
CHANGELOG.md
stack.yaml
package.yaml
stack.yaml
stack-8.10.yaml

source-repository head
type: git
Expand Down Expand Up @@ -61,14 +62,15 @@ library
default-extensions:
LambdaCase
OverloadedStrings
TypeOperators
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
build-depends:
Agda ==2.6.2.2
, aeson
, base >=4.7 && <5
, bytestring
, containers
, lsp <1.4
, lsp <1.5
, mtl
, network
, network-simple
Expand All @@ -84,6 +86,10 @@ executable als
Paths_agda_language_server
hs-source-dirs:
app
default-extensions:
LambdaCase
OverloadedStrings
TypeOperators
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
build-depends:
Agda ==2.6.2.2
Expand All @@ -92,7 +98,7 @@ executable als
, base >=4.7 && <5
, bytestring
, containers
, lsp <1.4
, lsp <1.5
, mtl
, network
, network-simple
Expand Down Expand Up @@ -139,14 +145,15 @@ test-suite als-test
default-extensions:
LambdaCase
OverloadedStrings
TypeOperators
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
build-depends:
Agda ==2.6.2.2
, aeson
, base >=4.7 && <5
, bytestring
, containers
, lsp <1.4
, lsp <1.5
, mtl
, network
, network-simple
Expand Down
19 changes: 9 additions & 10 deletions package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: agda-language-server
version: 0.2.1.0.2.2.6.2
version: 0.2.2.0.2.2.6.2
github: "banacorn/agda-language-server"
license: MIT
author: "Ting-Gian LUA"
Expand All @@ -9,8 +9,9 @@ copyright: "2020 Author name here :)"
extra-source-files:
- README.md
- CHANGELOG.md
- stack.yaml
- package.yaml
- stack.yaml
- stack-8.10.yaml

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

default-extensions:
- LambdaCase
- OverloadedStrings
- TypeOperators

dependencies:
- base >= 4.7 && < 5
- Agda == 2.6.2.2
- aeson
- bytestring
- containers
- lsp < 1.4
- lsp < 1.5
- mtl
- network
- network-simple
Expand All @@ -50,9 +56,6 @@ library:
- -Wmissing-signatures
- -Werror=incomplete-patterns
- -fno-warn-orphans
default-extensions:
- LambdaCase
- OverloadedStrings

executables:
als:
Expand Down Expand Up @@ -104,10 +107,6 @@ tests:
- -Werror=incomplete-patterns
- -fno-warn-orphans

default-extensions:
- LambdaCase
- OverloadedStrings

# tests:
# als-test:
# main: Spec.hs
Expand Down
10 changes: 5 additions & 5 deletions src/Agda/Position.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ toAgdaRange table path (LSP.Range start end) = Range
toAgdaPositionWithoutFile :: ToOffset -> LSP.Position -> PositionWithoutFile
toAgdaPositionWithoutFile table (LSP.Position line col) = Pn
()
(fromIntegral (toOffset table (line, col)) + 1)
(fromIntegral (toOffset table (fromIntegral line, fromIntegral col)) + 1)
(fromIntegral line + 1)
(fromIntegral col + 1)

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

-- Keeps record of offsets of every line break ("\n", "\r" and "\r\n")
--
-- Example text corresponding entry of IntMap
-- Example text corresponding entry of IntMap
-- >abc\n (1, 4)
-- >def123\r\n (2, 11)
-- >ghi\r (3, 15)
Expand Down Expand Up @@ -97,7 +97,7 @@ toOffset (ToOffset table) (line, col) = case IntMap.lookup line table of
-- An IntMap for speeding up Offset => Position convertion
-- Keeps record of offsets of every line break ("\n", "\r" and "\r\n")
--
-- Example text corresponding entry of IntMap
-- Example text corresponding entry of IntMap
-- >abc\n (4, 1)
-- >def123\r\n (11, 2)
-- >ghi\r (15, 3)
Expand All @@ -115,11 +115,11 @@ makeFromOffset = FromOffset . accumResult . Text.foldl'
(Accum Nothing 0 0 IntMap.empty)
where
go :: Accum -> Char -> Accum
-- encountered a "\r\n", update the latest entry
-- encountered a "\r\n", update the latest entry
go (Accum (Just '\r') n l table) '\n' = case IntMap.deleteFindMax table of
((offset, lineNo), table') ->
Accum (Just '\n') (1 + n) l (IntMap.insert (1 + offset) lineNo table')
-- encountered a line break, add a new entry
-- encountered a line break, add a new entry
go (Accum previous n l table) '\n' =
Accum (Just '\n') (1 + n) (1 + l) (IntMap.insert (1 + n) (1 + l) table)
go (Accum previous n l table) '\r' =
Expand Down
19 changes: 19 additions & 0 deletions stack-8.10.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
resolver: lts-18.28
compiler: ghc-8.10.7
# Allow a newer minor version of GHC than the snapshot specifies
compiler-check: newer-minor

packages:
- .

# Use some newer versions than in the lts-18.28 snapshot
extra-deps:
- Agda-2.6.2.2
- text-icu-0.8.0.1
- lsp-1.2.0.1
- lsp-types-1.3.0.1

flags:
Agda:
# optimise-heavily: true
enable-cluster-counting: true
9 changes: 3 additions & 6 deletions stack.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
resolver: lts-18.28
compiler: ghc-8.10.7
resolver: lts-19.33
compiler: ghc-9.0.2
# Allow a newer minor version of GHC than the snapshot specifies
compiler-check: newer-minor

packages:
- .

# Use some newer versions than in the lts-18.28 snapshot
# Use some newer versions than in the lts-19.33 snapshot
extra-deps:
- Agda-2.6.2.2
- text-icu-0.8.0.1
- lsp-1.2.0.1
- lsp-types-1.3.0.1

flags:
Agda:
Expand Down
29 changes: 4 additions & 25 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,16 @@
# https://docs.haskellstack.org/en/stable/lock_files

packages:
- completed:
hackage: Agda-2.6.2.2@sha256:b69c2f317db2886cb387134af00a3e42a06fab6422686938797924d034255a55,37047
pantry-tree:
sha256: 2f868d8f70a0f6bdbe96eff66ba1ec7a76b398cfc44dc57be525d7a67a44c9ab
size: 40002
original:
hackage: Agda-2.6.2.2
- completed:
hackage: text-icu-0.8.0.1@sha256:22d21c91e7a81f1ee5766b3406f4fe9df0ff8cc426581a861de3f6f2fa413449,4624
pantry-tree:
sha256: 71ed32ecdce71adba6df6220e717b8ec4bd252cc403714c5c4ba70cf6d1aa1e4
size: 3223
original:
hackage: text-icu-0.8.0.1
- completed:
hackage: lsp-1.2.0.1@sha256:4f037bbcdf2489a6a33351de1bf0cd89f94ad33a90338db4191ba34b3776af4e,5634
pantry-tree:
sha256: aecba0d6f2cfaeebae2053ebba6bb9f14d3edf732fdeea12e19bf4262f19ca18
size: 1417
original:
hackage: lsp-1.2.0.1
- completed:
hackage: lsp-types-1.3.0.1@sha256:e7bd6261f0560fbbcce6c35a2ceb9cd10034896367e1c73973a4a2d85d322b0c,4689
pantry-tree:
sha256: 11c9725e4ae4cbc0126d19c728ef13a8b2930faa65802def47f14c94eabc334d
size: 4146
original:
hackage: lsp-types-1.3.0.1
snapshots:
- completed:
sha256: 428ec8d5ce932190d3cbe266b9eb3c175cd81e984babf876b64019e2cbe4ea68
size: 590100
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/28.yaml
original: lts-18.28
sha256: 6d1532d40621957a25bad5195bfca7938e8a06d923c91bc52aa0f3c41181f2d4
size: 619204
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/33.yaml
original: lts-19.33

0 comments on commit c5c8b12

Please sign in to comment.