Compare commits

..

4 commits

Author SHA1 Message Date
sjcobb
385793a2ea specify lsp configuration in lang module 2025-05-30 13:29:04 +01:00
sjcobb
e08fd4dc9f do not auto enable lspconfig with lang module 2025-05-30 13:28:34 +01:00
sjcobb
b00b999f1d entryAnywhere for lspconfig 2025-05-30 13:27:44 +01:00
sjcobb
59f89ff96f enable lua function calls in cmd definition 2025-05-30 13:27:07 +01:00
4 changed files with 11 additions and 6 deletions

View file

@ -1,7 +1,7 @@
{lib}: let
inherit (builtins) isString getAttr;
inherit (lib.options) mkOption;
inherit (lib.types) listOf bool str submodule attrsOf anything either nullOr;
inherit (lib.types) listOf bool str submodule attrsOf anything either nullOr oneOf;
inherit (lib.nvim.attrsets) mapListToAttrs;
inherit (lib.nvim.types) luaInline;
in {
@ -62,7 +62,7 @@ in {
};
cmd = mkOption {
type = nullOr (listOf str);
type = nullOr (listOf (oneOf [str luaInline]));
default = null;
description = "Command used to start the LSP server";
};

View file

@ -11,7 +11,7 @@
inherit (lib.attrsets) mapAttrsToList attrNames filterAttrs;
inherit (lib.generators) mkLuaInline;
inherit (lib.nvim.languages) lspOptions;
inherit (lib.nvim.dag) entryAfter;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.lsp;
@ -82,8 +82,7 @@ in {
(mkIf (cfg.servers != {}) {
# Enable lspconfig in order to merge in the predefined opts
vim.lsp.lspconfig.enable = true;
vim.luaConfigRC.lsp-servers = entryAfter ["lspconfig"] ''
vim.luaConfigRC.lsp-servers = entryAnywhere ''
-- Individual LSP configurations managed by nvf.
${concatLines lspConfigurations}

View file

@ -20,7 +20,9 @@
servers = {
marksman = {
enable = true;
cmd = ["${pkgs.marksman}/bin/marksman" "server"];
cmd = [(getExe pkgs.marksman) "server"];
filetypes = ["markdown" "markdown.mdx"];
root_markers = [".marksman.toml" ".git"];
};
};

View file

@ -41,6 +41,8 @@
settings = {
nil = formattingCmd;
};
filetypes = ["nix"];
root_markers = [".git" "flake.nix"];
};
nixd = {
@ -49,6 +51,8 @@
settings = {
nixd = formattingCmd;
};
filetypes = ["nix"];
root_markers = [".git" "flake.nix"];
};
};