mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-11-08 22:45:30 +00:00
Merge 06aa186252 into 3e48f13c3c
This commit is contained in:
commit
7bdbbbf178
47 changed files with 643 additions and 490 deletions
|
|
@ -141,6 +141,9 @@
|
|||
- Use conform over custom autocmds for LSP format on save
|
||||
- Move LSP keybinds and other related plugin integrations into an LspAttach
|
||||
event.
|
||||
- Allow multiple formatters in language modules.
|
||||
- Fixed `prettier` in astro and svelte, and removed `prettierd` due to high
|
||||
complexity that would be needed to support it.
|
||||
|
||||
[diniamo](https://github.com/diniamo):
|
||||
|
||||
|
|
|
|||
48
flake/pkgs/by-name/prettier-plugin-astro/package.nix
Normal file
48
flake/pkgs/by-name/prettier-plugin-astro/package.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
nodejs,
|
||||
pnpm_9,
|
||||
pins,
|
||||
}: let
|
||||
pin = pins.prettier-plugin-astro;
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "prettier-plugin-astro";
|
||||
version = pin.version or pin.revision;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
inherit (pin.repository) owner repo;
|
||||
rev = finalAttrs.version;
|
||||
sha256 = pin.hash;
|
||||
};
|
||||
|
||||
pnpmDeps = pnpm_9.fetchDeps {
|
||||
inherit (finalAttrs) pname src;
|
||||
fetcherVersion = 2;
|
||||
hash = "sha256-K7pIWLkIIbUKDIcysfEtcf/eVMX9ZgyFHdqcuycHCNE=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
nodejs
|
||||
pnpm_9.configHook
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
pnpm run build
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
# mkdir -p $out/dist
|
||||
cp -r dist/ $out
|
||||
cp -r node_modules $out
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
})
|
||||
19
flake/pkgs/by-name/prettier-plugin-svelte/package.nix
Normal file
19
flake/pkgs/by-name/prettier-plugin-svelte/package.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
buildNpmPackage,
|
||||
fetchFromGitHub,
|
||||
pins,
|
||||
}: let
|
||||
pin = pins.prettier-plugin-svelte;
|
||||
in
|
||||
buildNpmPackage (finalAttrs: {
|
||||
pname = "prettier-plugin-svelte";
|
||||
version = pin.version or pin.revision;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
inherit (pin.repository) owner repo;
|
||||
rev = finalAttrs.version;
|
||||
sha256 = pin.hash;
|
||||
};
|
||||
|
||||
npmDepsHash = "sha256-D+gDdKiIG38jV+M/BqTKf0yYj1KXpbIodtQFdzocpn8=";
|
||||
})
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
{lib}: let
|
||||
inherit (builtins) warn toJSON;
|
||||
inherit (lib.options) mergeEqualOption;
|
||||
inherit (lib.lists) singleton;
|
||||
inherit (lib.strings) isString stringLength match;
|
||||
|
|
@ -29,5 +30,14 @@ in {
|
|||
check = v: isString v && (match "#?[0-9a-fA-F]{6}" v) != null;
|
||||
};
|
||||
|
||||
singleOrListOf = t: coercedTo t singleton (listOf t);
|
||||
# no compound types please
|
||||
deprecatedSingleOrListOf = option: t:
|
||||
coercedTo
|
||||
t
|
||||
(x:
|
||||
warn ''
|
||||
${option} no longer accepts non-list values, use [${toJSON x}] instead
|
||||
''
|
||||
(singleton x))
|
||||
(listOf t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,5 +10,5 @@ in {
|
|||
inherit (typesDag) dagOf;
|
||||
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType;
|
||||
inherit (typesLanguage) diagnostics mkGrammarOption;
|
||||
inherit (customTypes) char hexColor mergelessListOf singleOrListOf;
|
||||
inherit (customTypes) char hexColor mergelessListOf deprecatedSingleOrListOf;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,10 @@
|
|||
"Obsolete option `vim.languages.${lang}.lsp.server` used, use `vim.languages.${lang}.lsp.servers` instead."
|
||||
(head x);
|
||||
};
|
||||
|
||||
mkRemovedFormatPackage = lang: (mkRemovedOptionModule ["vim" "languages" lang "format" "package"] ''
|
||||
`vim.languages.${lang}.format.package` is removed, please use `vim.formatter.conform-nvim.formatters.<formatter_name>.command` instead.
|
||||
'');
|
||||
in {
|
||||
imports = concatLists [
|
||||
[
|
||||
|
|
@ -259,8 +263,38 @@ in {
|
|||
|
||||
(mkRenamedLspServer "zig")
|
||||
(mkRemovedLspPackage "zig")
|
||||
|
||||
(mkRemovedOptionModule ["vim" "language" "astro" "format"] ''
|
||||
This option has been removed due to being broken for a long time.
|
||||
'')
|
||||
(mkRemovedOptionModule ["vim" "language" "svelte" "format"] ''
|
||||
This option has been removed due to being broken for a long time.
|
||||
'')
|
||||
]
|
||||
|
||||
(map mkRemovedFormatPackage [
|
||||
"bash"
|
||||
"css"
|
||||
"elixir"
|
||||
"fsharp"
|
||||
"go"
|
||||
"hcl"
|
||||
"html"
|
||||
"json"
|
||||
"lua"
|
||||
"markdown"
|
||||
"nim"
|
||||
"nix"
|
||||
"ocaml"
|
||||
"python"
|
||||
"qml"
|
||||
"r"
|
||||
"ruby"
|
||||
"rust"
|
||||
"sql"
|
||||
"ts"
|
||||
"typst"
|
||||
])
|
||||
# Migrated via batchRenameOptions. Further batch renames must be below this line.
|
||||
renamedVimOpts
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,13 +1,58 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.options) mkOption mkEnableOption literalMD;
|
||||
inherit (lib.types) attrs either nullOr;
|
||||
inherit (lib.types) attrs either nullOr listOf submodule str;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.types) luaInline mkPluginSetupOption;
|
||||
|
||||
formattersType = submodule {
|
||||
freeformType = attrs;
|
||||
options = {
|
||||
command = mkOption {
|
||||
type = nullOr (either str luaInline);
|
||||
default = null;
|
||||
description = "The command to run.";
|
||||
};
|
||||
|
||||
args = mkOption {
|
||||
type = nullOr (either (listOf str) luaInline);
|
||||
default = null;
|
||||
description = ''
|
||||
A list of strings, or a lua function that returns a list of strings.
|
||||
|
||||
Return a single string instead of a list to run the command in a
|
||||
shell.
|
||||
'';
|
||||
};
|
||||
|
||||
prepend_args = mkOption {
|
||||
type = nullOr (either (listOf str) luaInline);
|
||||
default = null;
|
||||
description = ''
|
||||
When inherit = true, add additional arguments to the beginning of
|
||||
args. Can also be a function, like args.
|
||||
'';
|
||||
};
|
||||
|
||||
append_args = mkOption {
|
||||
type = nullOr (either (listOf str) luaInline);
|
||||
default = null;
|
||||
description = ''
|
||||
When inherit = true, add additional arguments to the end of args.
|
||||
Can also be a function, like args.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.formatter.conform-nvim = {
|
||||
enable = mkEnableOption "lightweight yet powerful formatter plugin for Neovim [conform-nvim]";
|
||||
setupOpts = mkPluginSetupOption "conform.nvim" {
|
||||
formatters = mkOption {
|
||||
type = formattersType;
|
||||
default = {};
|
||||
description = "Custom formatters and overrides for built-in formatters.";
|
||||
};
|
||||
formatters_by_ft = mkOption {
|
||||
type = attrs;
|
||||
default = {};
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ in {
|
|||
lsp = {
|
||||
enable = mkEnableOption "Assembly LSP support" // {default = config.vim.lsp.enable;};
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.asm.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Assembly LSP server to use";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
self,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
|
|
@ -8,9 +9,9 @@
|
|||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.types) enum package;
|
||||
inherit (lib.types) enum coercedTo;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics deprecatedSingleOrListOf;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
|
||||
cfg = config.vim.languages.astro;
|
||||
|
|
@ -40,23 +41,21 @@
|
|||
};
|
||||
};
|
||||
|
||||
# TODO: specify packages
|
||||
defaultFormat = "prettier";
|
||||
formats = {
|
||||
defaultFormat = ["prettier"];
|
||||
formats = let
|
||||
parser = "${self.packages.${pkgs.stdenv.system}.prettier-plugin-astro}/index.js";
|
||||
in {
|
||||
prettier = {
|
||||
package = pkgs.prettier;
|
||||
};
|
||||
|
||||
prettierd = {
|
||||
package = pkgs.prettierd;
|
||||
command = getExe pkgs.nodePackages.prettier;
|
||||
options.ft_parsers.astro = "astro";
|
||||
prepend_args = ["--plugin=${parser}"];
|
||||
};
|
||||
|
||||
biome = {
|
||||
package = pkgs.biome;
|
||||
command = getExe pkgs.biome;
|
||||
};
|
||||
};
|
||||
|
||||
# TODO: specify packages
|
||||
defaultDiagnosticsProvider = ["eslint_d"];
|
||||
diagnosticsProviders = {
|
||||
eslint_d = let
|
||||
|
|
@ -76,6 +75,15 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
formatType =
|
||||
deprecatedSingleOrListOf
|
||||
"vim.languages.astro.format.type"
|
||||
(coercedTo (enum ["prettierd"]) (_:
|
||||
lib.warn
|
||||
"vim.languages.astro.format.type: prettierd is deprecated, use prettier instead"
|
||||
"prettier")
|
||||
(enum (attrNames formats)));
|
||||
in {
|
||||
options.vim.languages.astro = {
|
||||
enable = mkEnableOption "Astro language support";
|
||||
|
|
@ -89,7 +97,7 @@ in {
|
|||
lsp = {
|
||||
enable = mkEnableOption "Astro LSP support" // {default = config.vim.lsp.enable;};
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.astro.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Astro LSP server to use";
|
||||
};
|
||||
|
|
@ -99,16 +107,10 @@ in {
|
|||
enable = mkEnableOption "Astro formatting" // {default = config.vim.languages.enableFormat;};
|
||||
|
||||
type = mkOption {
|
||||
type = enum (attrNames formats);
|
||||
type = formatType;
|
||||
default = defaultFormat;
|
||||
description = "Astro formatter to use";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
description = "Astro formatter package";
|
||||
};
|
||||
};
|
||||
|
||||
extraDiagnostics = {
|
||||
|
|
@ -140,9 +142,14 @@ in {
|
|||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.astro = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = {
|
||||
command = getExe cfg.format.package;
|
||||
setupOpts = {
|
||||
formatters_by_ft.astro = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@
|
|||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) enum package bool;
|
||||
inherit (lib.types) enum bool;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.types) diagnostics mkGrammarOption singleOrListOf;
|
||||
inherit (lib.nvim.types) diagnostics mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
cfg = config.vim.languages.bash;
|
||||
|
|
@ -30,10 +30,10 @@
|
|||
};
|
||||
};
|
||||
|
||||
defaultFormat = "shfmt";
|
||||
defaultFormat = ["shfmt"];
|
||||
formats = {
|
||||
shfmt = {
|
||||
package = pkgs.shfmt;
|
||||
command = getExe pkgs.shfmt;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ in {
|
|||
lsp = {
|
||||
enable = mkEnableOption "Bash LSP support" // {default = config.vim.lsp.enable;};
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.bash.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Bash LSP server to use";
|
||||
};
|
||||
|
|
@ -68,16 +68,10 @@ in {
|
|||
description = "Enable Bash formatting";
|
||||
};
|
||||
type = mkOption {
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.bash.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
description = "Bash formatter to use";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
description = "Bash formatter package";
|
||||
};
|
||||
};
|
||||
|
||||
extraDiagnostics = {
|
||||
|
|
@ -108,9 +102,14 @@ in {
|
|||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.sh = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = {
|
||||
command = getExe cfg.format.package;
|
||||
setupOpts = {
|
||||
formatters_by_ft.sh = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
|
||||
|
|
@ -194,7 +194,7 @@ in {
|
|||
|
||||
servers = mkOption {
|
||||
description = "The clang LSP server to use";
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.clang.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.types) enum listOf package;
|
||||
inherit (lib.types) enum listOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
inherit (lib.meta) getExe;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
|
|
@ -185,7 +185,7 @@ in {
|
|||
enable = mkEnableOption "C# LSP support" // {default = config.vim.lsp.enable;};
|
||||
servers = mkOption {
|
||||
description = "C# LSP server to use";
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.csharp.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) enum package;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
cfg = config.vim.languages.css;
|
||||
|
|
@ -30,34 +30,18 @@
|
|||
};
|
||||
};
|
||||
|
||||
defaultFormat = "prettier";
|
||||
defaultFormat = ["prettier"];
|
||||
formats = {
|
||||
prettier = {
|
||||
package = pkgs.prettier;
|
||||
command = getExe pkgs.prettier;
|
||||
};
|
||||
|
||||
prettierd = {
|
||||
package = pkgs.prettierd;
|
||||
nullConfig = ''
|
||||
table.insert(
|
||||
ls_sources,
|
||||
null_ls.builtins.formatting.prettier.with({
|
||||
command = "${cfg.format.package}/bin/prettierd",
|
||||
})
|
||||
)
|
||||
'';
|
||||
command = getExe pkgs.prettierd;
|
||||
};
|
||||
|
||||
biome = {
|
||||
package = pkgs.biome;
|
||||
nullConfig = ''
|
||||
table.insert(
|
||||
ls_sources,
|
||||
null_ls.builtins.formatting.biome.with({
|
||||
command = "${cfg.format.package}/bin/biome",
|
||||
})
|
||||
)
|
||||
'';
|
||||
command = getExe pkgs.biome;
|
||||
};
|
||||
};
|
||||
in {
|
||||
|
|
@ -74,7 +58,7 @@ in {
|
|||
enable = mkEnableOption "CSS LSP support" // {default = config.vim.lsp.enable;};
|
||||
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.css.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServer;
|
||||
description = "CSS LSP server to use";
|
||||
};
|
||||
|
|
@ -85,15 +69,9 @@ in {
|
|||
|
||||
type = mkOption {
|
||||
description = "CSS formatter to use";
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.css.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "CSS formatter package";
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -115,9 +93,14 @@ in {
|
|||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.css = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = {
|
||||
command = getExe cfg.format.package;
|
||||
setupOpts = {
|
||||
formatters_by_ft.css = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) enum package nullOr str bool;
|
||||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ in {
|
|||
lsp = {
|
||||
enable = mkEnableOption "Dart LSP support" // {default = config.vim.lsp.enable;};
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.dart.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Dart LSP server to use";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@
|
|||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.types) enum package;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
|
|
@ -40,13 +40,10 @@
|
|||
};
|
||||
};
|
||||
|
||||
defaultFormat = "mix";
|
||||
defaultFormat = ["mix"];
|
||||
formats = {
|
||||
mix = {
|
||||
package = pkgs.elixir;
|
||||
config = {
|
||||
command = "${cfg.format.package}/bin/mix";
|
||||
};
|
||||
command = "${pkgs.elixir}/bin/mix";
|
||||
};
|
||||
};
|
||||
in {
|
||||
|
|
@ -63,7 +60,7 @@ in {
|
|||
lsp = {
|
||||
enable = mkEnableOption "Elixir LSP support" // {default = config.vim.lsp.enable;};
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.elixir.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Elixir LSP server to use";
|
||||
};
|
||||
|
|
@ -73,16 +70,10 @@ in {
|
|||
enable = mkEnableOption "Elixir formatting" // {default = config.vim.languages.enableFormat;};
|
||||
|
||||
type = mkOption {
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.elixir.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
description = "Elixir formatter to use";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
description = "Elixir formatter package";
|
||||
};
|
||||
};
|
||||
|
||||
elixir-tools = {
|
||||
|
|
@ -112,9 +103,15 @@ in {
|
|||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.elixir = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} =
|
||||
formats.${cfg.format.type}.config;
|
||||
setupOpts = {
|
||||
formatters_by_ft.elixir = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@
|
|||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) package enum;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
defaultServer = ["fsautocomplete"];
|
||||
|
|
@ -51,10 +51,10 @@
|
|||
};
|
||||
};
|
||||
|
||||
defaultFormat = "fantomas";
|
||||
defaultFormat = ["fantomas"];
|
||||
formats = {
|
||||
fantomas = {
|
||||
package = pkgs.fantomas;
|
||||
command = getExe pkgs.fantomas;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ in {
|
|||
lsp = {
|
||||
enable = mkEnableOption "F# LSP support" // {default = config.vim.lsp.enable;};
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.fsharp.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServer;
|
||||
description = "F# LSP server to use";
|
||||
};
|
||||
|
|
@ -81,16 +81,10 @@ in {
|
|||
enable = mkEnableOption "F# formatting" // {default = config.vim.languages.enableFormat;};
|
||||
|
||||
type = mkOption {
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.fsharp.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
description = "F# formatter to use";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
description = "F# formatter package";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -113,9 +107,14 @@ in {
|
|||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.fsharp = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = {
|
||||
command = getExe cfg.format.package;
|
||||
setupOpts = {
|
||||
formatters_by_ft.fsharp = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
cfg = config.vim.languages.gleam;
|
||||
|
|
@ -35,7 +35,7 @@ in {
|
|||
lsp = {
|
||||
enable = mkEnableOption "Gleam LSP support" // {default = config.vim.lsp.enable;};
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.gleam.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Gleam LSP server to use";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
inherit (lib.meta) getExe;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.types) bool enum package;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
|
|
@ -59,19 +59,16 @@
|
|||
};
|
||||
};
|
||||
|
||||
defaultFormat = "gofmt";
|
||||
defaultFormat = ["gofmt"];
|
||||
formats = {
|
||||
gofmt = {
|
||||
package = pkgs.go;
|
||||
config.command = "${cfg.format.package}/bin/gofmt";
|
||||
command = "${pkgs.go}/bin/gofmt";
|
||||
};
|
||||
gofumpt = {
|
||||
package = pkgs.gofumpt;
|
||||
config.command = getExe cfg.format.package;
|
||||
command = getExe pkgs.gofumpt;
|
||||
};
|
||||
golines = {
|
||||
package = pkgs.golines;
|
||||
config.command = "${cfg.format.package}/bin/golines";
|
||||
command = "${pkgs.golines}/bin/golines";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -95,7 +92,7 @@ in {
|
|||
enable = mkEnableOption "Go LSP support" // {default = config.vim.lsp.enable;};
|
||||
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.go.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Go LSP server to use";
|
||||
};
|
||||
|
|
@ -113,15 +110,9 @@ in {
|
|||
|
||||
type = mkOption {
|
||||
description = "Go formatter to use";
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.go.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "Go formatter package";
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
};
|
||||
};
|
||||
|
||||
dap = {
|
||||
|
|
@ -163,8 +154,15 @@ in {
|
|||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.go = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = formats.${cfg.format.type}.config;
|
||||
setupOpts = {
|
||||
formatters_by_ft.go = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) package bool enum listOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
inherit (lib.types) bool enum listOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
cfg = config.vim.languages.hcl;
|
||||
|
|
@ -24,10 +24,10 @@
|
|||
};
|
||||
};
|
||||
|
||||
defaultFormat = "hclfmt";
|
||||
defaultFormat = ["hclfmt"];
|
||||
formats = {
|
||||
hclfmt = {
|
||||
package = pkgs.hclfmt;
|
||||
command = getExe pkgs.hclfmt;
|
||||
};
|
||||
};
|
||||
in {
|
||||
|
|
@ -55,15 +55,10 @@ in {
|
|||
description = "Enable HCL formatting";
|
||||
};
|
||||
type = mkOption {
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.hcl.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
description = "HCL formatter to use";
|
||||
};
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
description = "HCL formatter package";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -103,9 +98,14 @@ in {
|
|||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.hcl = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = {
|
||||
command = getExe cfg.format.package;
|
||||
setupOpts = {
|
||||
formatters_by_ft.hcl = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
inherit (lib.modules) mkDefault mkIf mkMerge;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
cfg = config.vim.languages.helm;
|
||||
|
|
@ -51,7 +51,7 @@ in {
|
|||
lsp = {
|
||||
enable = mkEnableOption "Helm LSP support" // {default = config.vim.lsp.enable;};
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.helm.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Helm LSP server to use";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@
|
|||
inherit (lib.meta) getExe;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) bool enum package;
|
||||
inherit (lib.types) bool enum;
|
||||
inherit (lib.lists) optional;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
|
|
@ -25,14 +25,11 @@
|
|||
};
|
||||
};
|
||||
|
||||
defaultFormat = "superhtml";
|
||||
defaultFormat = ["superhtml"];
|
||||
formats = {
|
||||
superhtml = {
|
||||
package = pkgs.writeShellApplication {
|
||||
name = "superhtml_fmt";
|
||||
runtimeInputs = [pkgs.superhtml];
|
||||
text = "superhtml fmt -";
|
||||
};
|
||||
command = "${pkgs.superhtml}/bin/superhtml";
|
||||
args = ["fmt" "-"];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -58,7 +55,7 @@ in {
|
|||
lsp = {
|
||||
enable = mkEnableOption "HTML LSP support" // {default = config.vim.lsp.enable;};
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.html.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "HTML LSP server to use";
|
||||
};
|
||||
|
|
@ -68,16 +65,10 @@ in {
|
|||
enable = mkEnableOption "HTML formatting" // {default = config.vim.languages.enableFormat;};
|
||||
|
||||
type = mkOption {
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.html.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
description = "HTML formatter to use";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
description = "HTML formatter package";
|
||||
};
|
||||
};
|
||||
|
||||
extraDiagnostics = {
|
||||
|
|
@ -119,9 +110,14 @@ in {
|
|||
(mkIf (cfg.format.enable && !cfg.lsp.enable) {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.html = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = {
|
||||
command = getExe cfg.format.package;
|
||||
setupOpts = {
|
||||
formatters_by_ft.html = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.meta) getExe' getExe;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) enum package;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
cfg = config.vim.languages.json;
|
||||
|
|
@ -24,15 +24,12 @@
|
|||
};
|
||||
};
|
||||
|
||||
defaultFormat = "jsonfmt";
|
||||
defaultFormat = ["jsonfmt"];
|
||||
|
||||
formats = {
|
||||
jsonfmt = {
|
||||
package = pkgs.writeShellApplication {
|
||||
name = "jsonfmt";
|
||||
runtimeInputs = [pkgs.jsonfmt];
|
||||
text = "jsonfmt -w -";
|
||||
};
|
||||
command = getExe pkgs.jsonfmt;
|
||||
args = ["-w" "-"];
|
||||
};
|
||||
};
|
||||
in {
|
||||
|
|
@ -49,7 +46,7 @@ in {
|
|||
enable = mkEnableOption "JSON LSP support" // {default = config.vim.lsp.enable;};
|
||||
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.json.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "JSON LSP server to use";
|
||||
};
|
||||
|
|
@ -60,15 +57,9 @@ in {
|
|||
|
||||
type = mkOption {
|
||||
description = "JSON formatter to use";
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.json.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "JSON formatter package";
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -90,9 +81,14 @@ in {
|
|||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.json = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = {
|
||||
command = getExe cfg.format.package;
|
||||
setupOpts = {
|
||||
formatters_by_ft.json = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
inherit (lib.types) enum;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.nvim.dag) entryBefore;
|
||||
|
|
@ -97,7 +97,7 @@ in {
|
|||
lsp = {
|
||||
enable = mkEnableOption "Julia LSP support" // {default = config.vim.lsp.enable;};
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.julia.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = ''
|
||||
Julia LSP Server to Use
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.types) bool enum listOf package;
|
||||
inherit (lib.nvim.types) diagnostics mkGrammarOption;
|
||||
inherit (lib.types) bool enum listOf;
|
||||
inherit (lib.nvim.types) diagnostics mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.dag) entryBefore;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
|
|
@ -34,10 +34,10 @@
|
|||
};
|
||||
};
|
||||
|
||||
defaultFormat = "stylua";
|
||||
defaultFormat = ["stylua"];
|
||||
formats = {
|
||||
stylua = {
|
||||
package = pkgs.stylua;
|
||||
command = getExe pkgs.stylua;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -79,16 +79,10 @@ in {
|
|||
description = "Enable Lua formatting";
|
||||
};
|
||||
type = mkOption {
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.lua.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
description = "Lua formatter to use";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
description = "Lua formatter package";
|
||||
};
|
||||
};
|
||||
|
||||
extraDiagnostics = {
|
||||
|
|
@ -132,9 +126,14 @@ in {
|
|||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.lua = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = {
|
||||
command = getExe cfg.format.package;
|
||||
setupOpts = {
|
||||
formatters_by_ft.lua = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (builtins) attrNames warn;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) bool enum package listOf str nullOr;
|
||||
inherit (lib.types) bool enum listOf str nullOr;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.types) diagnostics mkGrammarOption mkPluginSetupOption singleOrListOf;
|
||||
inherit (lib.nvim.types) diagnostics mkGrammarOption mkPluginSetupOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
|
|
@ -32,17 +32,17 @@
|
|||
};
|
||||
};
|
||||
|
||||
defaultFormat = "deno_fmt";
|
||||
defaultFormat = ["deno_fmt"];
|
||||
formats = {
|
||||
# for backwards compatibility
|
||||
denofmt = {
|
||||
package = pkgs.deno;
|
||||
command = getExe pkgs.deno;
|
||||
};
|
||||
deno_fmt = {
|
||||
package = pkgs.deno;
|
||||
command = getExe pkgs.deno;
|
||||
};
|
||||
prettierd = {
|
||||
package = pkgs.prettierd;
|
||||
command = getExe pkgs.prettierd;
|
||||
};
|
||||
};
|
||||
defaultDiagnosticsProvider = ["markdownlint-cli2"];
|
||||
|
|
@ -70,7 +70,7 @@ in {
|
|||
|
||||
servers = mkOption {
|
||||
description = "Markdown LSP server to use";
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.markdown.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
};
|
||||
};
|
||||
|
|
@ -79,17 +79,11 @@ in {
|
|||
enable = mkEnableOption "Markdown formatting" // {default = config.vim.languages.enableFormat;};
|
||||
|
||||
type = mkOption {
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.markdown.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
description = "Markdown formatter to use. `denofmt` is deprecated and currently aliased to deno_fmt.";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
description = "Markdown formatter package";
|
||||
};
|
||||
|
||||
extraFiletypes = mkOption {
|
||||
type = listOf str;
|
||||
default = [];
|
||||
|
|
@ -164,13 +158,23 @@ in {
|
|||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.markdown = [cfg.format.type];
|
||||
setupOpts.formatters.${
|
||||
if cfg.format.type == "denofmt"
|
||||
then "deno_fmt"
|
||||
else cfg.format.type
|
||||
} = {
|
||||
command = getExe cfg.format.package;
|
||||
setupOpts = {
|
||||
formatters_by_ft.markdown = cfg.format.type;
|
||||
formatters = let
|
||||
names = map (name:
|
||||
if name == "denofmt"
|
||||
then
|
||||
warn ''
|
||||
vim.languages.markdown.format.type: "denofmt" is renamed to "deno_fmt".
|
||||
'' "deno_fmt"
|
||||
else name)
|
||||
cfg.format.type;
|
||||
in
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
names;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.meta) getExe';
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) enum package;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
|
|
@ -37,13 +37,10 @@
|
|||
};
|
||||
};
|
||||
|
||||
defaultFormat = "nimpretty";
|
||||
defaultFormat = ["nimpretty"];
|
||||
formats = {
|
||||
nimpretty = {
|
||||
package = pkgs.nim;
|
||||
config = {
|
||||
command = "${cfg.format.package}/bin/nimpretty";
|
||||
};
|
||||
command = "${pkgs.nim}/bin/nimpretty";
|
||||
};
|
||||
};
|
||||
in {
|
||||
|
|
@ -59,7 +56,7 @@ in {
|
|||
enable = mkEnableOption "Nim LSP support" // {default = config.vim.lsp.enable;};
|
||||
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.nim.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Nim LSP server to use";
|
||||
};
|
||||
|
|
@ -68,16 +65,10 @@ in {
|
|||
format = {
|
||||
enable = mkEnableOption "Nim formatting" // {default = config.vim.languages.enableFormat;};
|
||||
type = mkOption {
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.nim.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
description = "Nim formatter to use";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
description = "Nim formatter package";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -108,8 +99,15 @@ in {
|
|||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.nim = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = formats.${cfg.format.type}.config;
|
||||
setupOpts = {
|
||||
formatters_by_ft.nim = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
inherit (lib.meta) getExe;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) enum package;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics singleOrListOf;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
cfg = config.vim.languages.nix;
|
||||
|
|
@ -18,10 +18,10 @@
|
|||
formattingCmd = mkIf (cfg.format.enable && cfg.lsp.enable) {
|
||||
formatting = mkMerge [
|
||||
(mkIf (cfg.format.type == "alejandra") {
|
||||
command = ["${cfg.format.package}/bin/alejandra" "--quiet"];
|
||||
command = [(getExe pkgs.alejandra) "--quiet"];
|
||||
})
|
||||
(mkIf (cfg.format.type == "nixfmt") {
|
||||
command = ["${cfg.format.package}/bin/nixfmt"];
|
||||
command = [(getExe pkgs.nixfmt-rfc-style)];
|
||||
})
|
||||
];
|
||||
};
|
||||
|
|
@ -49,14 +49,14 @@
|
|||
};
|
||||
};
|
||||
|
||||
defaultFormat = "alejandra";
|
||||
defaultFormat = ["alejandra"];
|
||||
formats = {
|
||||
alejandra = {
|
||||
package = pkgs.alejandra;
|
||||
command = getExe pkgs.alejandra;
|
||||
};
|
||||
|
||||
nixfmt = {
|
||||
package = pkgs.nixfmt-rfc-style;
|
||||
command = getExe pkgs.nixfmt-rfc-style;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ in {
|
|||
lsp = {
|
||||
enable = mkEnableOption "Nix LSP support" // {default = config.vim.lsp.enable;};
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.nix.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Nix LSP server to use";
|
||||
};
|
||||
|
|
@ -109,15 +109,9 @@ in {
|
|||
|
||||
type = mkOption {
|
||||
description = "Nix formatter to use";
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.nix.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "Nix formatter package";
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
};
|
||||
};
|
||||
|
||||
extraDiagnostics = {
|
||||
|
|
@ -161,9 +155,14 @@ in {
|
|||
(mkIf (cfg.format.enable && !cfg.lsp.enable) {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.nix = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = {
|
||||
command = getExe cfg.format.package;
|
||||
setupOpts = {
|
||||
formatters_by_ft.nix = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
|
@ -46,7 +46,7 @@ in {
|
|||
enable = mkEnableOption "Nu LSP support" // {default = config.vim.lsp.enable;};
|
||||
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.nu.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Nu LSP server to use";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.types) enum package;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
|
|
@ -55,10 +55,10 @@
|
|||
};
|
||||
};
|
||||
|
||||
defaultFormat = "ocamlformat";
|
||||
defaultFormat = ["ocamlformat"];
|
||||
formats = {
|
||||
ocamlformat = {
|
||||
package = pkgs.ocamlPackages.ocamlformat;
|
||||
command = getExe pkgs.ocamlPackages.ocamlformat;
|
||||
};
|
||||
};
|
||||
in {
|
||||
|
|
@ -74,7 +74,7 @@ in {
|
|||
enable = mkEnableOption "OCaml LSP support" // {default = config.vim.lsp.enable;};
|
||||
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.ocaml.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "OCaml LSP server to use";
|
||||
};
|
||||
|
|
@ -83,15 +83,10 @@ in {
|
|||
format = {
|
||||
enable = mkEnableOption "OCaml formatting support (ocamlformat)" // {default = config.vim.languages.enableFormat;};
|
||||
type = mkOption {
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.ocaml.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
description = "OCaml formatter to use";
|
||||
};
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
description = "OCaml formatter package";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -113,9 +108,14 @@ in {
|
|||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.ocaml = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = {
|
||||
command = getExe cfg.format.package;
|
||||
setupOpts = {
|
||||
formatters_by_ft.ocaml = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ in {
|
|||
enable = mkEnableOption "Odin LSP support" // {default = config.vim.lsp.enable;};
|
||||
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.odin.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Odin LSP server to use";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ in {
|
|||
enable = mkEnableOption "PHP LSP support" // {default = config.vim.lsp.enable;};
|
||||
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.php.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "PHP LSP server to use";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,13 +4,14 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (builtins) attrNames warn;
|
||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||
inherit (lib.lists) flatten;
|
||||
inherit (lib.meta) getExe getExe';
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) enum package bool;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.nvim.types) singleOrListOf;
|
||||
inherit (lib.nvim.types) deprecatedSingleOrListOf;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.dag) entryBefore;
|
||||
|
||||
|
|
@ -126,34 +127,22 @@
|
|||
};
|
||||
};
|
||||
|
||||
defaultFormat = "black";
|
||||
defaultFormat = ["black"];
|
||||
formats = {
|
||||
black = {
|
||||
package = pkgs.black;
|
||||
command = getExe pkgs.black;
|
||||
};
|
||||
|
||||
isort = {
|
||||
package = pkgs.isort;
|
||||
command = getExe pkgs.isort;
|
||||
};
|
||||
|
||||
black-and-isort = {
|
||||
package = pkgs.writeShellApplication {
|
||||
name = "black";
|
||||
runtimeInputs = [pkgs.black pkgs.isort];
|
||||
text = ''
|
||||
black --quiet - "$@" | isort --profile black -
|
||||
'';
|
||||
};
|
||||
};
|
||||
# dummy option for backwards compat
|
||||
black-and-isort = {};
|
||||
|
||||
ruff = {
|
||||
package = pkgs.writeShellApplication {
|
||||
name = "ruff";
|
||||
runtimeInputs = [pkgs.ruff];
|
||||
text = ''
|
||||
ruff format -
|
||||
'';
|
||||
};
|
||||
command = getExe pkgs.ruff;
|
||||
args = ["format" "-"];
|
||||
};
|
||||
|
||||
ruff-check = {
|
||||
|
|
@ -246,7 +235,7 @@ in {
|
|||
enable = mkEnableOption "Python LSP support" // {default = config.vim.lsp.enable;};
|
||||
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.python.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Python LSP server to use";
|
||||
};
|
||||
|
|
@ -256,15 +245,9 @@ in {
|
|||
enable = mkEnableOption "Python formatting" // {default = config.vim.languages.enableFormat;};
|
||||
|
||||
type = mkOption {
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.python.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
description = "Python formatter to use";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
description = "Python formatter package";
|
||||
description = "Python formatters to use";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -333,21 +316,27 @@ in {
|
|||
})
|
||||
|
||||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
vim.formatter.conform-nvim = let
|
||||
names = flatten (map (type:
|
||||
if type == "black-and-isort"
|
||||
then
|
||||
warn ''
|
||||
vim.languages.python.format.type: "black-and-isort" is deprecated,
|
||||
use `["black" "isort"]` instead.
|
||||
'' ["black" "isort"]
|
||||
else type)
|
||||
cfg.format.type);
|
||||
in {
|
||||
enable = true;
|
||||
# HACK: I'm planning to remove these soon so I just took the easiest way out
|
||||
setupOpts.formatters_by_ft.python =
|
||||
if cfg.format.type == "black-and-isort"
|
||||
then ["black"]
|
||||
else [cfg.format.type];
|
||||
setupOpts.formatters =
|
||||
if (cfg.format.type == "black-and-isort")
|
||||
then {
|
||||
black.command = "${cfg.format.package}/bin/black";
|
||||
}
|
||||
else {
|
||||
${cfg.format.type}.command = getExe cfg.format.package;
|
||||
};
|
||||
setupOpts = {
|
||||
formatters_by_ft.python = names;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
names;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (lib.meta) getExe getExe';
|
||||
inherit (lib.meta) getExe';
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) enum package;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
cfg = config.vim.languages.qml;
|
||||
|
|
@ -25,14 +25,12 @@
|
|||
};
|
||||
};
|
||||
|
||||
defaultFormat = "qmlformat";
|
||||
defaultFormat = ["qmlformat"];
|
||||
formats = {
|
||||
qmlformat = {
|
||||
package = pkgs.writeShellApplication {
|
||||
name = "qmlformat";
|
||||
runtimeInputs = [qmlPackage];
|
||||
text = "qmlformat -";
|
||||
};
|
||||
command = "${qmlPackage}/bin/qmlformat";
|
||||
args = ["-i" "$FILENAME"];
|
||||
stdin = false;
|
||||
};
|
||||
};
|
||||
in {
|
||||
|
|
@ -46,7 +44,7 @@ in {
|
|||
lsp = {
|
||||
enable = mkEnableOption "QML LSP support" // {default = config.vim.lsp.enable;};
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.qml.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "QML LSP server to use";
|
||||
};
|
||||
|
|
@ -56,16 +54,10 @@ in {
|
|||
enable = mkEnableOption "QML formatting" // {default = config.vim.languages.enableFormat;};
|
||||
|
||||
type = mkOption {
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.qml.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
description = "QML formatter to use";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
description = "QML formatter package";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -88,9 +80,14 @@ in {
|
|||
(mkIf (cfg.format.enable && !cfg.lsp.enable) {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.qml = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = {
|
||||
command = getExe cfg.format.package;
|
||||
setupOpts = {
|
||||
formatters_by_ft.qml = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@
|
|||
inherit (builtins) attrNames;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) enum package;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
|
||||
|
|
@ -19,35 +19,31 @@
|
|||
packages = [pkgs.rPackages.languageserver];
|
||||
};
|
||||
|
||||
defaultFormat = "format_r";
|
||||
defaultFormat = ["format_r"];
|
||||
formats = {
|
||||
styler = {
|
||||
package = pkgs.rWrapper.override {
|
||||
packages = [pkgs.rPackages.styler];
|
||||
};
|
||||
config = {
|
||||
command = "${cfg.format.package}/bin/R";
|
||||
};
|
||||
command = let
|
||||
pkg = pkgs.rWrapper.override {packages = [pkgs.rPackages.styler];};
|
||||
in "${pkg}/bin/R";
|
||||
};
|
||||
|
||||
format_r = {
|
||||
package = pkgs.rWrapper.override {
|
||||
packages = [pkgs.rPackages.formatR];
|
||||
};
|
||||
config = {
|
||||
command = "${cfg.format.package}/bin/R";
|
||||
stdin = true;
|
||||
args = [
|
||||
"--slave"
|
||||
"--no-restore"
|
||||
"--no-save"
|
||||
"-s"
|
||||
"-e"
|
||||
''formatR::tidy_source(source="stdin")''
|
||||
];
|
||||
# TODO: range_args seem to be possible
|
||||
# https://github.com/nvimtools/none-ls.nvim/blob/main/lua/null-ls/builtins/formatting/format_r.lua
|
||||
};
|
||||
command = let
|
||||
pkg = pkgs.rWrapper.override {
|
||||
packages = [pkgs.rPackages.formatR];
|
||||
};
|
||||
in "${pkg}/bin/R";
|
||||
stdin = true;
|
||||
args = [
|
||||
"--slave"
|
||||
"--no-restore"
|
||||
"--no-save"
|
||||
"-s"
|
||||
"-e"
|
||||
''formatR::tidy_source(source="stdin")''
|
||||
];
|
||||
# TODO: range_args seem to be possible
|
||||
# https://github.com/nvimtools/none-ls.nvim/blob/main/lua/null-ls/builtins/formatting/format_r.lua
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -77,7 +73,7 @@ in {
|
|||
enable = mkEnableOption "R LSP support" // {default = config.vim.lsp.enable;};
|
||||
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.r.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "R LSP server to use";
|
||||
};
|
||||
|
|
@ -87,16 +83,10 @@ in {
|
|||
enable = mkEnableOption "R formatting" // {default = config.vim.languages.enableFormat;};
|
||||
|
||||
type = mkOption {
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.r.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
description = "R formatter to use";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
description = "R formatter package";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -109,8 +99,15 @@ in {
|
|||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.r = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = formats.${cfg.format.type}.config;
|
||||
setupOpts = {
|
||||
formatters_by_ft.r = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics singleOrListOf;
|
||||
inherit (lib.types) package enum;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics deprecatedSingleOrListOf;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
cfg = config.vim.languages.ruby;
|
||||
|
|
@ -49,11 +49,10 @@
|
|||
|
||||
# testing
|
||||
|
||||
defaultFormat = "rubocop";
|
||||
defaultFormat = ["rubocop"];
|
||||
formats = {
|
||||
rubocop = {
|
||||
# TODO: is this right?
|
||||
package = pkgs.rubyPackages.rubocop;
|
||||
command = getExe pkgs.rubyPackages.rubocop;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -61,7 +60,6 @@
|
|||
diagnosticsProviders = {
|
||||
rubocop = {
|
||||
package = pkgs.rubyPackages.rubocop;
|
||||
config.command = getExe cfg.format.package;
|
||||
};
|
||||
};
|
||||
in {
|
||||
|
|
@ -77,7 +75,7 @@ in {
|
|||
enable = mkEnableOption "Ruby LSP support" // {default = config.vim.lsp.enable;};
|
||||
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.ruby.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Ruby LSP server to use";
|
||||
};
|
||||
|
|
@ -87,16 +85,10 @@ in {
|
|||
enable = mkEnableOption "Ruby formatter support" // {default = config.vim.languages.enableFormat;};
|
||||
|
||||
type = mkOption {
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.ruby.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
description = "Ruby formatter to use";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
description = "Ruby formatter package";
|
||||
};
|
||||
};
|
||||
|
||||
extraDiagnostics = {
|
||||
|
|
@ -130,9 +122,14 @@ in {
|
|||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.ruby = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = {
|
||||
command = getExe cfg.format.package;
|
||||
setupOpts = {
|
||||
formatters_by_ft.ruby = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -12,16 +12,17 @@
|
|||
inherit (lib.trivial) boolToString;
|
||||
inherit (lib.lists) isList;
|
||||
inherit (lib.types) bool package str listOf either enum;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAfter entryAnywhere;
|
||||
|
||||
cfg = config.vim.languages.rust;
|
||||
|
||||
defaultFormat = "rustfmt";
|
||||
defaultFormat = ["rustfmt"];
|
||||
formats = {
|
||||
rustfmt = {
|
||||
package = pkgs.rustfmt;
|
||||
command = getExe pkgs.rustfmt;
|
||||
};
|
||||
};
|
||||
in {
|
||||
|
|
@ -79,15 +80,9 @@ in {
|
|||
|
||||
type = mkOption {
|
||||
description = "Rust formatter to use";
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.rust.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "Rust formatter package";
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
};
|
||||
};
|
||||
|
||||
dap = {
|
||||
|
|
@ -130,9 +125,14 @@ in {
|
|||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.rust = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = {
|
||||
command = getExe cfg.format.package;
|
||||
setupOpts = {
|
||||
formatters_by_ft.rust = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) enum package str;
|
||||
inherit (lib.nvim.types) diagnostics singleOrListOf;
|
||||
inherit (lib.nvim.types) diagnostics deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
|
||||
|
|
@ -33,14 +33,11 @@
|
|||
};
|
||||
};
|
||||
|
||||
defaultFormat = "sqlfluff";
|
||||
defaultFormat = ["sqlfluff"];
|
||||
formats = {
|
||||
sqlfluff = {
|
||||
package = sqlfluffDefault;
|
||||
config = {
|
||||
command = getExe cfg.format.package;
|
||||
append_args = ["--dialect=${cfg.dialect}"];
|
||||
};
|
||||
command = getExe sqlfluffDefault;
|
||||
append_args = ["--dialect=${cfg.dialect}"];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -78,7 +75,7 @@ in {
|
|||
enable = mkEnableOption "SQL LSP support" // {default = config.vim.lsp.enable;};
|
||||
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.sql.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "SQL LSP server to use";
|
||||
};
|
||||
|
|
@ -88,16 +85,10 @@ in {
|
|||
enable = mkEnableOption "SQL formatting" // {default = config.vim.languages.enableFormat;};
|
||||
|
||||
type = mkOption {
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.sql.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
description = "SQL formatter to use";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
description = "SQL formatter package";
|
||||
};
|
||||
};
|
||||
|
||||
extraDiagnostics = {
|
||||
|
|
@ -133,8 +124,15 @@ in {
|
|||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.sql = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = formats.${cfg.format.type}.config;
|
||||
setupOpts = {
|
||||
formatters_by_ft.sql = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
self,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
|
|
@ -8,8 +9,8 @@
|
|||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.types) enum package;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics singleOrListOf;
|
||||
inherit (lib.types) enum package coercedTo;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
|
||||
|
|
@ -53,15 +54,19 @@
|
|||
};
|
||||
};
|
||||
|
||||
# TODO: specify packages
|
||||
defaultFormat = "prettier";
|
||||
formats = {
|
||||
defaultFormat = ["prettier"];
|
||||
formats = let
|
||||
prettierPlugin = self.packages.${pkgs.stdenv.system}.prettier-plugin-svelte;
|
||||
prettierPluginPath = "${prettierPlugin}/lib/node_modules/prettier-plugin-svelte/plugin.js";
|
||||
in {
|
||||
prettier = {
|
||||
package = pkgs.prettier;
|
||||
command = getExe pkgs.nodePackages.prettier;
|
||||
options.ft_parsers.svelte = "svelte";
|
||||
prepend_args = ["--plugin=${prettierPluginPath}"];
|
||||
};
|
||||
|
||||
biome = {
|
||||
package = pkgs.biome;
|
||||
command = getExe pkgs.biome;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -85,6 +90,15 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
formatType =
|
||||
deprecatedSingleOrListOf
|
||||
"vim.languages.svelte.format.type"
|
||||
(coercedTo (enum ["prettierd"]) (_:
|
||||
lib.warn
|
||||
"vim.languages.svelte.format.type: prettierd is deprecated, use prettier instead"
|
||||
"prettier")
|
||||
(enum (attrNames formats)));
|
||||
in {
|
||||
options.vim.languages.svelte = {
|
||||
enable = mkEnableOption "Svelte language support";
|
||||
|
|
@ -99,7 +113,7 @@ in {
|
|||
enable = mkEnableOption "Svelte LSP support" // {default = config.vim.lsp.enable;};
|
||||
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.svelte.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Svelte LSP server to use";
|
||||
};
|
||||
|
|
@ -109,16 +123,10 @@ in {
|
|||
enable = mkEnableOption "Svelte formatting" // {default = config.vim.languages.enableFormat;};
|
||||
|
||||
type = mkOption {
|
||||
type = enum (attrNames formats);
|
||||
type = formatType;
|
||||
default = defaultFormat;
|
||||
description = "Svelte formatter to use";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
description = "Svelte formatter package";
|
||||
};
|
||||
};
|
||||
|
||||
extraDiagnostics = {
|
||||
|
|
@ -150,9 +158,14 @@ in {
|
|||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.svelte = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = {
|
||||
command = getExe cfg.format.package;
|
||||
setupOpts = {
|
||||
formatters_by_ft.svelte = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
inherit (lib.meta) getExe;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.nvim.types) singleOrListOf;
|
||||
inherit (lib.nvim.types) deprecatedSingleOrListOf;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
|
||||
cfg = config.vim.languages.tailwind;
|
||||
|
|
@ -154,7 +154,7 @@ in {
|
|||
enable = mkEnableOption "Tailwindcss LSP support" // {default = config.vim.lsp.enable;};
|
||||
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.tailwind.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Tailwindcss LSP server to use";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics mkPluginSetupOption singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics mkPluginSetupOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.dag) entryAnywhere entryBefore;
|
||||
|
||||
cfg = config.vim.languages.ts;
|
||||
|
|
@ -173,18 +173,18 @@
|
|||
'';
|
||||
|
||||
# TODO: specify packages
|
||||
defaultFormat = "prettier";
|
||||
defaultFormat = ["prettier"];
|
||||
formats = {
|
||||
prettier = {
|
||||
package = pkgs.prettier;
|
||||
command = getExe pkgs.prettier;
|
||||
};
|
||||
|
||||
prettierd = {
|
||||
package = pkgs.prettierd;
|
||||
command = getExe pkgs.prettierd;
|
||||
};
|
||||
|
||||
biome = {
|
||||
package = pkgs.biome;
|
||||
command = getExe pkgs.biome;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -225,7 +225,7 @@ in {
|
|||
enable = mkEnableOption "Typescript/Javascript LSP support" // {default = config.vim.lsp.enable;};
|
||||
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.ts.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Typescript/Javascript LSP server to use";
|
||||
};
|
||||
|
|
@ -236,15 +236,9 @@ in {
|
|||
|
||||
type = mkOption {
|
||||
description = "Typescript/Javascript formatter to use";
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.ts.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "Typescript/Javascript formatter package";
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
};
|
||||
};
|
||||
|
||||
extraDiagnostics = {
|
||||
|
|
@ -306,12 +300,15 @@ in {
|
|||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
formatters_by_ft.typescript = [cfg.format.type];
|
||||
formatters_by_ft.typescript = cfg.format.type;
|
||||
# .tsx files
|
||||
formatters_by_ft.typescriptreact = [cfg.format.type];
|
||||
formatters.${cfg.format.type} = {
|
||||
command = getExe cfg.format.package;
|
||||
};
|
||||
formatters_by_ft.typescriptreact = cfg.format.type;
|
||||
setupOpts.formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
inherit (lib.types) nullOr enum attrsOf listOf package str bool int;
|
||||
inherit (lib.attrsets) attrNames;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
|
@ -92,14 +92,14 @@
|
|||
};
|
||||
};
|
||||
|
||||
defaultFormat = "typstfmt";
|
||||
defaultFormat = ["typstfmt"];
|
||||
formats = {
|
||||
typstfmt = {
|
||||
package = pkgs.typstfmt;
|
||||
command = getExe pkgs.typstfmt;
|
||||
};
|
||||
# https://github.com/Enter-tainer/typstyle
|
||||
typstyle = {
|
||||
package = pkgs.typstyle;
|
||||
command = getExe pkgs.typstyle;
|
||||
};
|
||||
};
|
||||
in {
|
||||
|
|
@ -115,7 +115,7 @@ in {
|
|||
enable = mkEnableOption "Typst LSP support (typst-lsp)" // {default = config.vim.lsp.enable;};
|
||||
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.typst.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Typst LSP server to use";
|
||||
};
|
||||
|
|
@ -125,16 +125,10 @@ in {
|
|||
enable = mkEnableOption "Typst document formatting" // {default = config.vim.languages.enableFormat;};
|
||||
|
||||
type = mkOption {
|
||||
type = enum (attrNames formats);
|
||||
type = deprecatedSingleOrListOf "vim.language.typst.format.type" (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
description = "Typst formatter to use";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
description = "Typst formatter package";
|
||||
};
|
||||
};
|
||||
|
||||
extensions = {
|
||||
|
|
@ -241,9 +235,14 @@ in {
|
|||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.typst = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = {
|
||||
command = getExe cfg.format.package;
|
||||
setupOpts = {
|
||||
formatters_by_ft.typst = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ in {
|
|||
lsp = {
|
||||
enable = mkEnableOption "Vala LSP support" // {default = config.vim.lsp.enable;};
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.vala.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Vala LSP server to use";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.meta) getExe;
|
||||
|
|
@ -37,7 +37,7 @@ in {
|
|||
enable = mkEnableOption "WGSL LSP support" // {default = config.vim.lsp.enable;};
|
||||
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.wgsl.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "WGSL LSP server to use";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
cfg = config.vim.languages.yaml;
|
||||
|
|
@ -59,7 +59,7 @@ in {
|
|||
lsp = {
|
||||
enable = mkEnableOption "Yaml LSP support" // {default = config.vim.lsp.enable;};
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.yaml.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Yaml LSP server to use";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge mkDefault;
|
||||
inherit (lib.types) bool package enum;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ in {
|
|||
enable = mkEnableOption "Zig LSP support" // {default = config.vim.lsp.enable;};
|
||||
|
||||
servers = mkOption {
|
||||
type = singleOrListOf (enum (attrNames servers));
|
||||
type = deprecatedSingleOrListOf "vim.language.zig.lsp.servers" (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Zig LSP server to use";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2218,6 +2218,38 @@
|
|||
"url": "https://github.com/tris203/precognition.nvim/archive/2aae2687207029b3611a0e19a289f9e1c7efbe16.tar.gz",
|
||||
"hash": "0b4yz5jvqd0li373067cs1n761vn9jxkhcvhsrvm9h1snqw1c6nk"
|
||||
},
|
||||
"prettier-plugin-astro": {
|
||||
"type": "GitRelease",
|
||||
"repository": {
|
||||
"type": "GitHub",
|
||||
"owner": "withastro",
|
||||
"repo": "prettier-plugin-astro"
|
||||
},
|
||||
"pre_releases": false,
|
||||
"version_upper_bound": null,
|
||||
"release_prefix": null,
|
||||
"submodules": false,
|
||||
"version": "v0.14.1",
|
||||
"revision": "57234893ca374c8e401cce1f931180d314e13eac",
|
||||
"url": "https://api.github.com/repos/withastro/prettier-plugin-astro/tarball/v0.14.1",
|
||||
"hash": "14ffwxggcnyc947pdxgsgz1v2q76m5xmybfxg8kyla4l7phg6qsw"
|
||||
},
|
||||
"prettier-plugin-svelte": {
|
||||
"type": "GitRelease",
|
||||
"repository": {
|
||||
"type": "GitHub",
|
||||
"owner": "sveltejs",
|
||||
"repo": "prettier-plugin-svelte"
|
||||
},
|
||||
"pre_releases": false,
|
||||
"version_upper_bound": null,
|
||||
"release_prefix": null,
|
||||
"submodules": false,
|
||||
"version": "v3.3.2",
|
||||
"revision": "76c04ebfdff4306842e8ab0cd96b1c53c7041dde",
|
||||
"url": "https://api.github.com/repos/sveltejs/prettier-plugin-svelte/tarball/v3.3.2",
|
||||
"hash": "0g6h5lvhyms6nvk83vkd3yi8rvsz2v5g6cw03fqsv2nj45s6cf7r"
|
||||
},
|
||||
"project-nvim": {
|
||||
"type": "Git",
|
||||
"repository": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue