Compare commits

..

2 commits

Author SHA1 Message Date
Artur Manuel
087b38383a
Merge 59dc44f9c1 into a0a57757a0 2024-12-17 00:35:44 +00:00
Artur Manuel
59dc44f9c1 plugins/languages: add haskell support 2024-12-17 00:35:30 +00:00
2 changed files with 5 additions and 10 deletions

View file

@ -10,15 +10,13 @@
inherit (lib.strings) optionalString;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.dag) entryAfter;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) expToLua;
inherit (pkgs) haskellPackages;
cfg = config.vim.languages.haskell;
in {
options.vim.languages.haskell = {
enable = mkEnableOption "Haskell support";
treesitter = {
enable = mkEnableOption "Treesitter support for Haskell" // {default = config.vim.languages.enableTreesitter;};
package = mkGrammarOption pkgs "haskell";
@ -43,7 +41,6 @@ in {
};
};
};
config = mkIf cfg.enable (mkMerge [
(mkIf cfg.treesitter.enable {
vim.treesitter = {
@ -51,13 +48,11 @@ in {
grammars = [cfg.treesitter.package];
};
})
(mkIf (cfg.dap.enable || cfg.lsp.enable) {
vim = {
startPlugins = ["haskell-tools-nvim"];
luaConfigRC.haskell-tools-nvim =
entryAfter
["lsp-setup"]
entryAnywhere
''
vim.g.haskell_tools = {
${optionalString cfg.lsp.enable ''

View file

@ -13,7 +13,7 @@
inherit (lib.types) bool package str listOf either enum;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.dag) entryAfter;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.languages.rust;
@ -102,7 +102,7 @@ in {
startPlugins = ["crates-nvim"];
lsp.null-ls.enable = mkIf cfg.crates.codeActions true;
autocomplete.nvim-cmp.sources = {crates = "[Crates]";};
pluginRC.rust-crates = entryAfter ["lsp-setup"] ''
pluginRC.rust-crates = entryAnywhere ''
require('crates').setup {
null_ls = {
enabled = ${boolToString cfg.crates.codeActions},
@ -127,7 +127,7 @@ in {
vim = {
startPlugins = ["rustaceanvim"];
luaConfigRC.rustaceanvim = entryAfter ["lsp-setup"] ''
luaConfigRC.rustaceanvim = entryAnywhere ''
vim.g.rustaceanvim = {
${optionalString cfg.lsp.enable ''
-- LSP