mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-11-16 10:25:31 +00:00
languages: convert language modules M-Z
This commit is contained in:
parent
dade4b6ed6
commit
64fbc41f29
22 changed files with 341 additions and 445 deletions
|
|
@ -12,6 +12,7 @@
|
|||
inherit (lib.lists) isList;
|
||||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.types) anything attrsOf enum either listOf nullOr package str;
|
||||
inherit (lib.nvim.languages) lspOptions;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
||||
inherit (lib.nvim.lua) expToLua toLuaObject;
|
||||
|
||||
|
|
@ -20,11 +21,12 @@
|
|||
useFormat = "on_attach = default_on_attach";
|
||||
noFormat = "on_attach = attach_keymaps";
|
||||
|
||||
defaultServer = "nil";
|
||||
packageToCmd = package: defaultCmd:
|
||||
if isList package
|
||||
then expToLua package
|
||||
else ''{"${package}/bin/${defaultCmd}"}'';
|
||||
|
||||
defaultServer = "nil";
|
||||
servers = {
|
||||
nil = {
|
||||
package = pkgs.nil;
|
||||
|
|
@ -145,9 +147,9 @@ in {
|
|||
lsp = {
|
||||
enable = mkEnableOption "Nix LSP support" // {default = config.vim.languages.enableLSP;};
|
||||
server = mkOption {
|
||||
type = listOf (enum (attrNames servers));
|
||||
default = [defaultServer];
|
||||
description = "Nix LSP server to use";
|
||||
type = enum (attrNames servers);
|
||||
default = defaultServer;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
|
|
@ -156,12 +158,6 @@ in {
|
|||
type = either package (listOf str);
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
};
|
||||
|
||||
options = mkOption {
|
||||
type = nullOr (attrsOf anything);
|
||||
default = null;
|
||||
description = "Options to pass to nixd LSP server";
|
||||
};
|
||||
};
|
||||
|
||||
format = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue