dhall-lang / dhall-haskell

Maintainable configuration files
https://dhall-lang.org/
BSD 3-Clause "New" or "Revised" License
912 stars 213 forks source link

feat: Add support for LSP 2 #2560

Closed Vekhir closed 9 months ago

Vekhir commented 9 months ago

@mmhat Building upon #2531, this further adds support for

This is a minimum refactoring by essentially following the compile errors and fixing them one by one without major structural changes. Most changes are just renaming.

No thoughts were given to backwards compatibility within LSP - the above versions are also the minimum requirement for dhall-lsp-server. This is consistent with GHC 9.6.

Note

I had this diff lying around for a few days and it has been verified in my build for updating Arch packages to GHC 9.6.

Supersedes #2428

Vekhir commented 9 months ago

@mmhat Rather obvious in hindsight, I've now updated the stack configuration to use the newer lsp libraries. Not sure what to do about the hydra/nix issue.

mmhat commented 9 months ago

@Vekhir Thank you for doing this! I am about to review the work you did so far. Regarding the Hydra issue: I am an ArchLinux user as well, so I faced the same problems while working on #2531 . I used the following to update packages in the Nix setup:

# We assume that the current directory is the root of the checked out work tree.
# Start a container with the work tree mounted under /work.
# (I use podman nowadays; docker should work as well.)
podman run -it --rm -v .:/work -w /work docker.io/nixos/nix
# Now we are in the container. We need to install cabal-install and cabal2nix:
nix-env -i cabal-install -i cabal2nix
# cabal2nix needs a hackage index tarball:
cabal update
# Now we generate the Nix expression for the lsp-2.1.0.0 package and store it in the right location:
cabal2nix cabal://lsp-2.1.0.0 > ./nix/packages/lsp.nix
Vekhir commented 9 months ago

@mmhat I've implemented your suggestions and fixed the CI build - it will hopefully pass now.

Vekhir commented 9 months ago

Hydra now works, lets see if the rest works now too

Vekhir commented 9 months ago

This check will most probably fail for GHC 8.10 since hashable 1.3.5.0 needs ghc-bignum, but I want to see the error message. If stack provides a compatible version for ghc-bignum, then we are likely done.

Vekhir commented 9 months ago

Failed due to typo... Fixed it now

Vekhir commented 9 months ago

@mmhat Looks like we are done. If you don't have any objections, you can merge it. Is there something you want/need done to make a Hackage release? Would make Arch integration easier.

mmhat commented 9 months ago

@Vekhir Can you please rebase your changes onto main?

Regarding a new release: Those are done by @Gabriella439 , so I think we have to be a bit more patient.

EDIT: Never mind, Github managed to merge it but the UI didn't show.

mmhat commented 9 months ago

@Vekhir Nice, excellent work! Thank you!

Vekhir commented 9 months ago

It's not urgent anyway. Thanks for your suggestions and reviewing!