1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-08 19:46:06 +01:00

plugins/haskell-tools: init

Signed-off-by: saygo-png <saygo.mail@proton.me>
This commit is contained in:
saygo-png 2025-09-29 00:09:37 +02:00 committed by Matt Sturgeon
parent b9e5bac7bc
commit 74423f4a53
2 changed files with 341 additions and 0 deletions

View file

@ -0,0 +1,64 @@
{
lib,
config,
pkgs,
...
}:
lib.nixvim.plugins.mkNeovimPlugin {
name = "haskell-tools";
package = "haskell-tools-nvim";
maintainers = [ lib.maintainers.saygo-png ];
# This is a filetype plugin that doesn't use a setup function.
# Configuration is passed to a global table.
callSetup = false;
extraOptions = {
enableTelescope = lib.mkEnableOption "telescope integration";
hlsPackage = lib.mkPackageOption pkgs "haskell-language-server" {
nullable = true;
};
};
settingsExample = {
hls = {
default_settings = {
haskell = {
formattingProvider = "ormolu";
plugin = {
hlint = {
codeActionsOn = false;
diagnosticsOn = false;
};
importLens = {
globalOn = false;
codeActionsOn = false;
codeLensOn = false;
};
};
};
};
};
};
extraConfig = cfg: {
globals.haskell_tools = cfg.settings;
extraPackages = [ cfg.hlsPackage ];
plugins.telescope.enabledExtensions = lib.mkIf cfg.enableTelescope [ "ht" ];
assertions = lib.nixvim.mkAssertions "plugins.haskell-tools" {
assertion = cfg.enableTelescope -> config.plugins.telescope.enable;
message = "The haskell-tools telescope integration needs telescope to function as intended.";
};
warnings = lib.nixvim.mkWarnings "plugins.haskell-tools" [
{
when = config.lsp.servers.hls.enable || config.plugins.lsp.servers.hls.enable;
message = ''
It is recommended to disable hls when using haskell-tools
as it can cause conflicts. The plugin sets up the server already.
'';
}
];
};
}