Skip to content

modules/lsp/hls: port ghcPackage option from plugins.lsp#3805

Draft
MattSturgeon wants to merge 1 commit intonix-community:mainfrom
MattSturgeon:lsp-port-custom-options
Draft

modules/lsp/hls: port ghcPackage option from plugins.lsp#3805
MattSturgeon wants to merge 1 commit intonix-community:mainfrom
MattSturgeon:lsp-port-custom-options

Conversation

@MattSturgeon
Copy link
Copy Markdown
Member

WIP PR to begin porting plugins.lsp server-specific options to the new lsp module. Depends on #3783.

Open questions:

  • Do we still want installXyz and xyzPackage options, or just nullable package options?
  • Which options should be ported to lsp and which to plugins.lspconfig?
@sportshead
Copy link
Copy Markdown
Contributor

IIRC from my previous testing installing hls will cause a version (not sure if its the default nixpkgs one) of ghc to be in the closure, since hls has a dependency on ghc. Therefore I don't think installGhc actually does anything apart from possibly wasting another ~3gb of disk space, since the extra ghc will only be available in nvim (where it isn't needed) anyway.

@sportshead
Copy link
Copy Markdown
Contributor

Had a quick test and hls works with installGhc = false (using plugins.lsp). I do think packageFallback is much more useful for haskell – hls loves to complain whenever the bundled ghc version is not the exact same as the workspace ghc version.

@saygo-png
Copy link
Copy Markdown
Contributor

hls works with installGhc = false

I've tested it and it does not. I used nix-shell with --pure to get a clean environment. You most likely have ghc in your path from somewhere else, which is why it worked for you.
image

That said I much prefer a nullable package here instead of an install option. I think it's more idiomatic and consistent with the rest of Nixvim and other Nix projects like home-manager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants