mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-28 13:58:41 +02:00
added formatter + reformat existing codebase
This commit is contained in:
parent
0bf4313f22
commit
1cab8e5167
96 changed files with 3727 additions and 3341 deletions
|
@ -1,13 +1,17 @@
|
|||
{ pkgs, config, lib, ... }@args:
|
||||
with lib;
|
||||
let
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
} @ args:
|
||||
with lib; let
|
||||
helpers = import ./helpers.nix args;
|
||||
servers = [
|
||||
{
|
||||
name = "astro";
|
||||
description = "Enable astrols, for Astro";
|
||||
package = pkgs.nodePackages."@astrojs/language-server";
|
||||
cmd = cfg: [ "${cfg.package}/bin/astro-ls" "--stdio" ];
|
||||
cmd = cfg: ["${cfg.package}/bin/astro-ls" "--stdio"];
|
||||
}
|
||||
{
|
||||
name = "bashls";
|
||||
|
@ -23,7 +27,7 @@ let
|
|||
name = "cssls";
|
||||
description = "Enable cssls, for CSS";
|
||||
package = pkgs.nodePackages.vscode-langservers-extracted;
|
||||
cmd = cfg: [ "${cfg.package}/bin/vscode-css-language-server" "--stdio" ];
|
||||
cmd = cfg: ["${cfg.package}/bin/vscode-css-language-server" "--stdio"];
|
||||
}
|
||||
{
|
||||
name = "dartls";
|
||||
|
@ -70,7 +74,7 @@ let
|
|||
'';
|
||||
};
|
||||
renameFilesWithClasses = mkOption {
|
||||
type = types.nullOr (types.enum [ "always" "prompt" ]);
|
||||
type = types.nullOr (types.enum ["always" "prompt"]);
|
||||
default = null;
|
||||
description = ''
|
||||
When set to "always", will include edits to rename files when classes are renamed if the
|
||||
|
@ -98,7 +102,7 @@ let
|
|||
'';
|
||||
};
|
||||
documentation = mkOption {
|
||||
type = types.nullOr (types.enum [ "none" "summary" "full" ]);
|
||||
type = types.nullOr (types.enum ["none" "summary" "full"]);
|
||||
default = null;
|
||||
description = ''
|
||||
The typekind of dartdocs to include in Hovers, Code Completion, Signature Help and other
|
||||
|
@ -114,7 +118,7 @@ let
|
|||
'';
|
||||
};
|
||||
};
|
||||
settings = cfg: { dart = cfg; };
|
||||
settings = cfg: {dart = cfg;};
|
||||
}
|
||||
{
|
||||
name = "denols";
|
||||
|
@ -125,13 +129,13 @@ let
|
|||
name = "eslint";
|
||||
description = "Enable eslint";
|
||||
package = pkgs.nodePackages.vscode-langservers-extracted;
|
||||
cmd = cfg: [ "${cfg.package}/bin/vscode-eslint-language-server" "--stdio" ];
|
||||
cmd = cfg: ["${cfg.package}/bin/vscode-eslint-language-server" "--stdio"];
|
||||
}
|
||||
{
|
||||
name = "elixirls";
|
||||
description = "Enable elixirls";
|
||||
package = pkgs.elixir_ls;
|
||||
cmd = cfg: [ "${cfg.package}/bin/elixir-ls" ];
|
||||
cmd = cfg: ["${cfg.package}/bin/elixir-ls"];
|
||||
}
|
||||
{
|
||||
name = "gdscript";
|
||||
|
@ -146,13 +150,13 @@ let
|
|||
name = "html";
|
||||
description = "Enable html, for HTML";
|
||||
package = pkgs.nodePackages.vscode-langservers-extracted;
|
||||
cmd = cfg: [ "${cfg.package}/bin/vscode-html-language-server" "--stdio" ];
|
||||
cmd = cfg: ["${cfg.package}/bin/vscode-html-language-server" "--stdio"];
|
||||
}
|
||||
{
|
||||
name = "jsonls";
|
||||
description = "Enable jsonls, for JSON";
|
||||
package = pkgs.nodePackages.vscode-langservers-extracted;
|
||||
cmd = cfg: [ "${cfg.package}/bin/vscode-json-language-server" "--stdio" ];
|
||||
cmd = cfg: ["${cfg.package}/bin/vscode-json-language-server" "--stdio"];
|
||||
}
|
||||
{
|
||||
name = "nil_ls";
|
||||
|
@ -170,7 +174,7 @@ let
|
|||
diagnostics = {
|
||||
ignored = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
default = [];
|
||||
description = ''
|
||||
Ignored diagnostic kinds.
|
||||
The kind identifier is a snake_cased_string usually shown together
|
||||
|
@ -179,7 +183,7 @@ let
|
|||
};
|
||||
excludedFiles = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
default = [];
|
||||
description = ''
|
||||
Files to exclude from showing diagnostics. Useful for generated files.
|
||||
It accepts an array of paths. Relative paths are joint to the workspace root.
|
||||
|
@ -188,7 +192,7 @@ let
|
|||
};
|
||||
};
|
||||
};
|
||||
settings = cfg: { nil = { inherit (cfg) formatting diagnostics; }; };
|
||||
settings = cfg: {nil = {inherit (cfg) formatting diagnostics;};};
|
||||
}
|
||||
{
|
||||
name = "pyright";
|
||||
|
@ -205,7 +209,7 @@ let
|
|||
serverName = "rust_analyzer";
|
||||
|
||||
settingsOptions = import ./rust-analyzer-config.nix lib;
|
||||
settings = cfg: { rust-analyzer = cfg; };
|
||||
settings = cfg: {rust-analyzer = cfg;};
|
||||
}
|
||||
{
|
||||
name = "sumneko-lua";
|
||||
|
@ -240,10 +244,9 @@ let
|
|||
name = "hls";
|
||||
description = "Enable haskell language server";
|
||||
package = pkgs.haskell-language-server;
|
||||
cmd = cfg: [ "haskell-language-server-wrapper" ];
|
||||
cmd = cfg: ["haskell-language-server-wrapper"];
|
||||
}
|
||||
];
|
||||
in
|
||||
{
|
||||
in {
|
||||
imports = lib.lists.map (helpers.mkLsp) servers;
|
||||
}
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.plugins.lsp;
|
||||
helpers = (import ../helpers.nix { inherit lib; });
|
||||
in
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.plugins.lsp;
|
||||
helpers = import ../helpers.nix {inherit lib;};
|
||||
in {
|
||||
imports = [
|
||||
./basic-servers.nix
|
||||
];
|
||||
|
@ -14,24 +17,25 @@ in
|
|||
enable = mkEnableOption "neovim's built-in LSP";
|
||||
|
||||
enabledServers = mkOption {
|
||||
type = with types; listOf (oneOf [
|
||||
str
|
||||
(submodule {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = str;
|
||||
description = "The server's name";
|
||||
};
|
||||
type = with types;
|
||||
listOf (oneOf [
|
||||
str
|
||||
(submodule {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = str;
|
||||
description = "The server's name";
|
||||
};
|
||||
|
||||
extraOptions = mkOption {
|
||||
type = attrs;
|
||||
description = "Extra options for the server";
|
||||
extraOptions = mkOption {
|
||||
type = attrs;
|
||||
description = "Extra options for the server";
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
]);
|
||||
})
|
||||
]);
|
||||
description = "A list of enabled LSP servers. Don't use this directly.";
|
||||
default = [ ];
|
||||
default = [];
|
||||
};
|
||||
|
||||
onAttach = mkOption {
|
||||
|
@ -43,7 +47,7 @@ in
|
|||
setupWrappers = mkOption {
|
||||
type = with types; listOf (functionTo str);
|
||||
description = "Code to be run to wrap the setup args. Takes in an argument containing the previous results, and returns a new string of code.";
|
||||
default = [ ];
|
||||
default = [];
|
||||
};
|
||||
|
||||
preConfig = mkOption {
|
||||
|
@ -60,14 +64,14 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config =
|
||||
let
|
||||
runWrappers = wrappers: s:
|
||||
if wrappers == [ ] then s
|
||||
else (head wrappers) (runWrappers (tail wrappers) s);
|
||||
in
|
||||
config = let
|
||||
runWrappers = wrappers: s:
|
||||
if wrappers == []
|
||||
then s
|
||||
else (head wrappers) (runWrappers (tail wrappers) s);
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
extraPlugins = [ pkgs.vimPlugins.nvim-lspconfig ];
|
||||
extraPlugins = [pkgs.vimPlugins.nvim-lspconfig];
|
||||
|
||||
# Enable all LSP servers
|
||||
extraConfigLua = ''
|
||||
|
|
|
@ -1,51 +1,65 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
|
||||
{
|
||||
mkLsp =
|
||||
{ name
|
||||
, description ? "Enable ${name}."
|
||||
, serverName ? name
|
||||
, package ? pkgs.${name}
|
||||
, extraPackages ? { }
|
||||
, cmd ? (cfg: null)
|
||||
, settings ? (cfg: { })
|
||||
, settingsOptions ? { }
|
||||
, ...
|
||||
}:
|
||||
# returns a module
|
||||
{ pkgs, config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.plugins.lsp.servers.${name};
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
mkLsp = {
|
||||
name,
|
||||
description ? "Enable ${name}.",
|
||||
serverName ? name,
|
||||
package ? pkgs.${name},
|
||||
extraPackages ? {},
|
||||
cmd ? (cfg: null),
|
||||
settings ? (cfg: {}),
|
||||
settingsOptions ? {},
|
||||
...
|
||||
}:
|
||||
# returns a module
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.plugins.lsp.servers.${name};
|
||||
|
||||
packageOption =
|
||||
if package != null then {
|
||||
package = mkOption {
|
||||
default = package;
|
||||
type = types.nullOr types.package;
|
||||
};
|
||||
} else { };
|
||||
in
|
||||
{
|
||||
options = {
|
||||
plugins.lsp.servers.${name} = {
|
||||
packageOption =
|
||||
if package != null
|
||||
then {
|
||||
package = mkOption {
|
||||
default = package;
|
||||
type = types.nullOr types.package;
|
||||
};
|
||||
}
|
||||
else {};
|
||||
in {
|
||||
options = {
|
||||
plugins.lsp.servers.${name} =
|
||||
{
|
||||
enable = mkEnableOption description;
|
||||
settings = settingsOptions;
|
||||
} // packageOption;
|
||||
};
|
||||
}
|
||||
// packageOption;
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable
|
||||
{
|
||||
extraPackages = (optional (package != null) cfg.package) ++
|
||||
(mapAttrsToList (name: _: cfg."${name}Package") extraPackages);
|
||||
config =
|
||||
mkIf cfg.enable
|
||||
{
|
||||
extraPackages =
|
||||
(optional (package != null) cfg.package)
|
||||
++ (mapAttrsToList (name: _: cfg."${name}Package") extraPackages);
|
||||
|
||||
plugins.lsp.enabledServers = [{
|
||||
plugins.lsp.enabledServers = [
|
||||
{
|
||||
name = serverName;
|
||||
extraOptions = {
|
||||
cmd = cmd cfg;
|
||||
settings = settings cfg.settings;
|
||||
};
|
||||
}];
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.plugins.lsp-lines;
|
||||
helpers = import ../helpers.nix { inherit lib; };
|
||||
in
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.plugins.lsp-lines;
|
||||
helpers = import ../helpers.nix {inherit lib;};
|
||||
in {
|
||||
options = {
|
||||
plugins.lsp-lines = {
|
||||
enable = mkEnableOption "lsp_lines.nvim";
|
||||
|
@ -19,24 +22,25 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config =
|
||||
let
|
||||
diagnosticConfig = {
|
||||
virtual_text = false;
|
||||
virtual_lines =
|
||||
if cfg.currentLine then {
|
||||
only_current_line = true;
|
||||
} else true;
|
||||
};
|
||||
in
|
||||
config = let
|
||||
diagnosticConfig = {
|
||||
virtual_text = false;
|
||||
virtual_lines =
|
||||
if cfg.currentLine
|
||||
then {
|
||||
only_current_line = true;
|
||||
}
|
||||
else true;
|
||||
};
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
extraPlugins = [ cfg.package ];
|
||||
extraPlugins = [cfg.package];
|
||||
|
||||
extraConfigLua = ''
|
||||
do
|
||||
require("lsp_lines").setup()
|
||||
|
||||
vim.diagnostic.config(${ helpers.toLuaObject diagnosticConfig })
|
||||
vim.diagnostic.config(${helpers.toLuaObject diagnosticConfig})
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.plugins.lspsaga;
|
||||
helpers = import ../helpers.nix { inherit lib; };
|
||||
in
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.plugins.lspsaga;
|
||||
helpers = import ../helpers.nix {inherit lib;};
|
||||
in {
|
||||
options = {
|
||||
plugins.lspsaga = {
|
||||
enable = mkEnableOption "lspsaga.nvim";
|
||||
|
@ -107,32 +110,31 @@ in
|
|||
description = "Maximum finder preview lines";
|
||||
};
|
||||
|
||||
keys =
|
||||
let
|
||||
defaultKeyOpt = desc: mkOption {
|
||||
keys = let
|
||||
defaultKeyOpt = desc:
|
||||
mkOption {
|
||||
description = desc;
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
in
|
||||
{
|
||||
finderAction = {
|
||||
open = defaultKeyOpt "Open from finder";
|
||||
vsplit = defaultKeyOpt "Vertical split in finder";
|
||||
split = defaultKeyOpt "Horizontal split in finder";
|
||||
quit = defaultKeyOpt "Quit finder";
|
||||
scrollDown = defaultKeyOpt "Scroll down finder";
|
||||
scrollUp = defaultKeyOpt "Scroll up finder";
|
||||
};
|
||||
|
||||
codeAction = {
|
||||
quit = defaultKeyOpt "Quit code actions menu";
|
||||
exec = defaultKeyOpt "Execute code action";
|
||||
};
|
||||
in {
|
||||
finderAction = {
|
||||
open = defaultKeyOpt "Open from finder";
|
||||
vsplit = defaultKeyOpt "Vertical split in finder";
|
||||
split = defaultKeyOpt "Horizontal split in finder";
|
||||
quit = defaultKeyOpt "Quit finder";
|
||||
scrollDown = defaultKeyOpt "Scroll down finder";
|
||||
scrollUp = defaultKeyOpt "Scroll up finder";
|
||||
};
|
||||
|
||||
codeAction = {
|
||||
quit = defaultKeyOpt "Quit code actions menu";
|
||||
exec = defaultKeyOpt "Execute code action";
|
||||
};
|
||||
};
|
||||
|
||||
borderStyle = mkOption {
|
||||
type = types.nullOr (types.enum [ "thin" "rounded" "thick" ]);
|
||||
type = types.nullOr (types.enum ["thin" "rounded" "thick"]);
|
||||
default = null;
|
||||
description = "Border style";
|
||||
};
|
||||
|
@ -145,71 +147,75 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config =
|
||||
let
|
||||
notDefault = default: opt: if (opt != default) then opt else null;
|
||||
notEmpty = opt: if ((filterAttrs (_: v: v != null) opt) != { }) then opt else null;
|
||||
notNull = opt: opt;
|
||||
lspsagaConfig = {
|
||||
use_saga_diagnostic_sign = notDefault true cfg.signs.use;
|
||||
error_sign = notNull cfg.signs.error;
|
||||
warn_sign = notNull cfg.signs.warning;
|
||||
hint_sign = notNull cfg.signs.hint;
|
||||
infor_sign = notNull cfg.signs.info;
|
||||
config = let
|
||||
notDefault = default: opt:
|
||||
if (opt != default)
|
||||
then opt
|
||||
else null;
|
||||
notEmpty = opt:
|
||||
if ((filterAttrs (_: v: v != null) opt) != {})
|
||||
then opt
|
||||
else null;
|
||||
notNull = opt: opt;
|
||||
lspsagaConfig = {
|
||||
use_saga_diagnostic_sign = notDefault true cfg.signs.use;
|
||||
error_sign = notNull cfg.signs.error;
|
||||
warn_sign = notNull cfg.signs.warning;
|
||||
hint_sign = notNull cfg.signs.hint;
|
||||
infor_sign = notNull cfg.signs.info;
|
||||
|
||||
# TODO Fix this!
|
||||
# error_header = notNull cfg.headers.error;
|
||||
# warn_header = notNull cfg.headers.warning;
|
||||
# hint_header = notNull cfg.headers.hint;
|
||||
# infor_header = notNull cfg.headers.info;
|
||||
# TODO Fix this!
|
||||
# error_header = notNull cfg.headers.error;
|
||||
# warn_header = notNull cfg.headers.warning;
|
||||
# hint_header = notNull cfg.headers.hint;
|
||||
# infor_header = notNull cfg.headers.info;
|
||||
|
||||
max_diag_msg_width = notNull cfg.maxDialogWidth;
|
||||
max_diag_msg_width = notNull cfg.maxDialogWidth;
|
||||
|
||||
code_action_icon = notNull cfg.icons.codeAction;
|
||||
finder_definition_icon = notNull cfg.icons.findDefinition;
|
||||
finder_reference_icon = notNull cfg.icons.findReference;
|
||||
definition_preview_icon = notNull cfg.icons.definitionPreview;
|
||||
code_action_icon = notNull cfg.icons.codeAction;
|
||||
finder_definition_icon = notNull cfg.icons.findDefinition;
|
||||
finder_reference_icon = notNull cfg.icons.findReference;
|
||||
definition_preview_icon = notNull cfg.icons.definitionPreview;
|
||||
|
||||
max_finder_preview_lines = notNull cfg.maxFinderPreviewLines;
|
||||
max_finder_preview_lines = notNull cfg.maxFinderPreviewLines;
|
||||
|
||||
rename_prompt_prefix = notNull cfg.renamePromptPrefix;
|
||||
rename_prompt_prefix = notNull cfg.renamePromptPrefix;
|
||||
|
||||
border_style =
|
||||
let
|
||||
borderStyle =
|
||||
if cfg.borderStyle == "thin" then 1
|
||||
else if cfg.borderStyle == "rounded" then 2
|
||||
else if cfg.borderStyle == "thick" then 3
|
||||
else null;
|
||||
in
|
||||
borderStyle;
|
||||
border_style = let
|
||||
borderStyle =
|
||||
if cfg.borderStyle == "thin"
|
||||
then 1
|
||||
else if cfg.borderStyle == "rounded"
|
||||
then 2
|
||||
else if cfg.borderStyle == "thick"
|
||||
then 3
|
||||
else null;
|
||||
in
|
||||
borderStyle;
|
||||
|
||||
finder_action_keys =
|
||||
let
|
||||
keys = {
|
||||
open = notNull cfg.keys.finderAction.open;
|
||||
vsplit = notNull cfg.keys.finderAction.vsplit;
|
||||
split = notNull cfg.keys.finderAction.split;
|
||||
quit = notNull cfg.keys.finderAction.quit;
|
||||
scroll_down = notNull cfg.keys.finderAction.scrollDown;
|
||||
scroll_up = notNull cfg.keys.finderAction.scrollUp;
|
||||
};
|
||||
in
|
||||
notEmpty keys;
|
||||
finder_action_keys = let
|
||||
keys = {
|
||||
open = notNull cfg.keys.finderAction.open;
|
||||
vsplit = notNull cfg.keys.finderAction.vsplit;
|
||||
split = notNull cfg.keys.finderAction.split;
|
||||
quit = notNull cfg.keys.finderAction.quit;
|
||||
scroll_down = notNull cfg.keys.finderAction.scrollDown;
|
||||
scroll_up = notNull cfg.keys.finderAction.scrollUp;
|
||||
};
|
||||
in
|
||||
notEmpty keys;
|
||||
|
||||
code_action_keys =
|
||||
let
|
||||
keys = {
|
||||
quit = notNull cfg.keys.codeAction.quit;
|
||||
exec = notNull cfg.keys.codeAction.exec;
|
||||
};
|
||||
in
|
||||
notEmpty keys;
|
||||
};
|
||||
in
|
||||
code_action_keys = let
|
||||
keys = {
|
||||
quit = notNull cfg.keys.codeAction.quit;
|
||||
exec = notNull cfg.keys.codeAction.exec;
|
||||
};
|
||||
in
|
||||
notEmpty keys;
|
||||
};
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
|
||||
extraPlugins = [ cfg.package ];
|
||||
extraPlugins = [cfg.package];
|
||||
|
||||
extraConfigLua = ''
|
||||
local saga = require 'lspsaga'
|
||||
|
|
|
@ -1,70 +1,69 @@
|
|||
{ pkgs
|
||||
, lib
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
helpers = import ../helpers.nix { inherit lib; };
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
helpers = import ../helpers.nix {inherit lib;};
|
||||
in
|
||||
with lib; {
|
||||
options.plugins.nvim-lightbulb = {
|
||||
enable = mkEnableOption "nvim-lightbulb, showing available code actions";
|
||||
with lib; {
|
||||
options.plugins.nvim-lightbulb = {
|
||||
enable = mkEnableOption "nvim-lightbulb, showing available code actions";
|
||||
|
||||
package = helpers.mkPackageOption "nvim-lightbulb" pkgs.vimPlugins.nvim-lightbulb;
|
||||
package = helpers.mkPackageOption "nvim-lightbulb" pkgs.vimPlugins.nvim-lightbulb;
|
||||
|
||||
ignore = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
|
||||
LSP client names to ignore
|
||||
'';
|
||||
|
||||
sign = {
|
||||
enabled = helpers.defaultNullOpts.mkBool true "";
|
||||
priority = helpers.defaultNullOpts.mkInt 10 "";
|
||||
};
|
||||
|
||||
float = {
|
||||
enabled = helpers.defaultNullOpts.mkBool false "";
|
||||
|
||||
text = helpers.defaultNullOpts.mkStr "💡" "Text to show in the popup float";
|
||||
|
||||
winOpts = helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "{}" ''
|
||||
Options for the floating window (see |vim.lsp.util.open_floating_preview| for more information)
|
||||
ignore = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
|
||||
LSP client names to ignore
|
||||
'';
|
||||
};
|
||||
|
||||
virtualText = {
|
||||
enabled = helpers.defaultNullOpts.mkBool false "";
|
||||
sign = {
|
||||
enabled = helpers.defaultNullOpts.mkBool true "";
|
||||
priority = helpers.defaultNullOpts.mkInt 10 "";
|
||||
};
|
||||
|
||||
text = helpers.defaultNullOpts.mkStr "💡" "Text to show at virtual text";
|
||||
float = {
|
||||
enabled = helpers.defaultNullOpts.mkBool false "";
|
||||
|
||||
hlMode = helpers.defaultNullOpts.mkStr "replace" ''
|
||||
highlight mode to use for virtual text (replace, combine, blend), see
|
||||
:help nvim_buf_set_extmark() for reference
|
||||
'';
|
||||
};
|
||||
text = helpers.defaultNullOpts.mkStr "💡" "Text to show in the popup float";
|
||||
|
||||
statusText = {
|
||||
enabled = helpers.defaultNullOpts.mkBool false "";
|
||||
winOpts = helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "{}" ''
|
||||
Options for the floating window (see |vim.lsp.util.open_floating_preview| for more information)
|
||||
'';
|
||||
};
|
||||
|
||||
text = helpers.defaultNullOpts.mkStr "💡" "Text to provide when code actions are available";
|
||||
virtualText = {
|
||||
enabled = helpers.defaultNullOpts.mkBool false "";
|
||||
|
||||
textUnavailable = helpers.defaultNullOpts.mkStr "" ''
|
||||
Text to provide when no actions are available
|
||||
'';
|
||||
};
|
||||
text = helpers.defaultNullOpts.mkStr "💡" "Text to show at virtual text";
|
||||
|
||||
autocmd = {
|
||||
enabled = helpers.defaultNullOpts.mkBool false "";
|
||||
hlMode = helpers.defaultNullOpts.mkStr "replace" ''
|
||||
highlight mode to use for virtual text (replace, combine, blend), see
|
||||
:help nvim_buf_set_extmark() for reference
|
||||
'';
|
||||
};
|
||||
|
||||
pattern = helpers.defaultNullOpts.mkNullable (types.listOf types.str) ''["*"]'' "";
|
||||
statusText = {
|
||||
enabled = helpers.defaultNullOpts.mkBool false "";
|
||||
|
||||
events =
|
||||
helpers.defaultNullOpts.mkNullable (types.listOf types.str)
|
||||
text = helpers.defaultNullOpts.mkStr "💡" "Text to provide when code actions are available";
|
||||
|
||||
textUnavailable = helpers.defaultNullOpts.mkStr "" ''
|
||||
Text to provide when no actions are available
|
||||
'';
|
||||
};
|
||||
|
||||
autocmd = {
|
||||
enabled = helpers.defaultNullOpts.mkBool false "";
|
||||
|
||||
pattern = helpers.defaultNullOpts.mkNullable (types.listOf types.str) ''["*"]'' "";
|
||||
|
||||
events =
|
||||
helpers.defaultNullOpts.mkNullable (types.listOf types.str)
|
||||
''["CursorHold" "CursorHoldI"]'' "";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config =
|
||||
let
|
||||
config = let
|
||||
cfg = config.plugins.nvim-lightbulb;
|
||||
setupOptions = {
|
||||
inherit (cfg) ignore sign autocmd;
|
||||
|
@ -82,10 +81,10 @@ with lib; {
|
|||
};
|
||||
};
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
extraPlugins = [ cfg.package ];
|
||||
extraConfigLua = ''
|
||||
require("nvim-lightbulb").setup(${helpers.toLuaObject setupOptions})
|
||||
'';
|
||||
};
|
||||
}
|
||||
mkIf cfg.enable {
|
||||
extraPlugins = [cfg.package];
|
||||
extraConfigLua = ''
|
||||
require("nvim-lightbulb").setup(${helpers.toLuaObject setupOptions})
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
# THIS FILE IS AUTOGENERATED DO NOT EDIT
|
||||
lib: with lib; {
|
||||
lib:
|
||||
with lib; {
|
||||
"assist" = {
|
||||
"expressionFillDefault" = mkOption {
|
||||
type = types.nullOr (types.enum [ "todo" "default" ]);
|
||||
type = types.nullOr (types.enum ["todo" "default"]);
|
||||
default = null;
|
||||
description = ''
|
||||
Placeholder expression to use for missing expressions in assists.
|
||||
|
@ -105,7 +106,7 @@ lib: with lib; {
|
|||
};
|
||||
};
|
||||
"features" = mkOption {
|
||||
type = types.nullOr (types.oneOf [ (types.enum [ "all" ]) (types.listOf (types.str)) ]);
|
||||
type = types.nullOr (types.oneOf [(types.enum ["all"]) (types.listOf (types.str))]);
|
||||
default = null;
|
||||
description = ''
|
||||
List of features to activate.
|
||||
|
@ -217,7 +218,7 @@ lib: with lib; {
|
|||
'';
|
||||
};
|
||||
"features" = mkOption {
|
||||
type = types.nullOr (types.nullOr (types.oneOf [ (types.enum [ "all" ]) (types.listOf (types.str)) ]));
|
||||
type = types.nullOr (types.nullOr (types.oneOf [(types.enum ["all"]) (types.listOf (types.str))]));
|
||||
default = null;
|
||||
description = ''
|
||||
List of features to activate. Defaults to
|
||||
|
@ -320,7 +321,7 @@ lib: with lib; {
|
|||
};
|
||||
"callable" = {
|
||||
"snippets" = mkOption {
|
||||
type = types.nullOr (types.enum [ "fill_arguments" "add_parentheses" "none" ]);
|
||||
type = types.nullOr (types.enum ["fill_arguments" "add_parentheses" "none"]);
|
||||
default = null;
|
||||
description = ''
|
||||
Whether to add parenthesis and argument snippets when completing function.
|
||||
|
@ -508,7 +509,7 @@ lib: with lib; {
|
|||
'';
|
||||
};
|
||||
"watcher" = mkOption {
|
||||
type = types.nullOr (types.enum [ "client" "server" ]);
|
||||
type = types.nullOr (types.enum ["client" "server"]);
|
||||
default = null;
|
||||
description = ''
|
||||
Controls file watching implementation.
|
||||
|
@ -727,7 +728,7 @@ lib: with lib; {
|
|||
'';
|
||||
};
|
||||
"group" = mkOption {
|
||||
type = types.nullOr (types.enum [ "preserve" "crate" "module" "item" ]);
|
||||
type = types.nullOr (types.enum ["preserve" "crate" "module" "item"]);
|
||||
default = null;
|
||||
description = ''
|
||||
How imports should be grouped into use statements.
|
||||
|
@ -768,7 +769,7 @@ lib: with lib; {
|
|||
};
|
||||
};
|
||||
"prefix" = mkOption {
|
||||
type = types.nullOr (types.enum [ "plain" "self" "crate" ]);
|
||||
type = types.nullOr (types.enum ["plain" "self" "crate"]);
|
||||
default = null;
|
||||
description = ''
|
||||
The path structure for newly inserted paths to use.
|
||||
|
@ -838,7 +839,7 @@ lib: with lib; {
|
|||
};
|
||||
"closureReturnTypeHints" = {
|
||||
"enable" = mkOption {
|
||||
type = types.nullOr (types.enum [ "always" "never" "with_block" ]);
|
||||
type = types.nullOr (types.enum ["always" "never" "with_block"]);
|
||||
default = null;
|
||||
description = ''
|
||||
Whether to show inlay type hints for return types of closures.
|
||||
|
@ -852,7 +853,7 @@ lib: with lib; {
|
|||
};
|
||||
"lifetimeElisionHints" = {
|
||||
"enable" = mkOption {
|
||||
type = types.nullOr (types.enum [ "always" "never" "skip_trivial" ]);
|
||||
type = types.nullOr (types.enum ["always" "never" "skip_trivial"]);
|
||||
default = null;
|
||||
description = ''
|
||||
Whether to show inlay type hints for elided lifetimes in function signatures.
|
||||
|
@ -905,7 +906,7 @@ lib: with lib; {
|
|||
};
|
||||
"reborrowHints" = {
|
||||
"enable" = mkOption {
|
||||
type = types.nullOr (types.enum [ "always" "never" "mutable" ]);
|
||||
type = types.nullOr (types.enum ["always" "never" "mutable"]);
|
||||
default = null;
|
||||
description = ''
|
||||
Whether to show inlay type hints for compiler inserted reborrows.
|
||||
|
@ -1154,7 +1155,7 @@ lib: with lib; {
|
|||
};
|
||||
};
|
||||
"linkedProjects" = mkOption {
|
||||
type = types.nullOr (types.listOf (types.oneOf [ (types.str) (types.attrsOf types.anything) ]));
|
||||
type = types.nullOr (types.listOf (types.oneOf [(types.str) (types.attrsOf types.anything)]));
|
||||
default = null;
|
||||
description = ''
|
||||
Disable project auto-discovery in favor of explicitly specified set
|
||||
|
@ -1471,7 +1472,7 @@ lib: with lib; {
|
|||
};
|
||||
"signatureInfo" = {
|
||||
"detail" = mkOption {
|
||||
type = types.nullOr (types.enum [ "full" "parameters" ]);
|
||||
type = types.nullOr (types.enum ["full" "parameters"]);
|
||||
default = null;
|
||||
description = ''
|
||||
Show full signature of the callable. Only shows parameters if disabled.
|
||||
|
@ -1517,7 +1518,7 @@ lib: with lib; {
|
|||
"symbol" = {
|
||||
"search" = {
|
||||
"kind" = mkOption {
|
||||
type = types.nullOr (types.enum [ "only_types" "all_symbols" ]);
|
||||
type = types.nullOr (types.enum ["only_types" "all_symbols"]);
|
||||
default = null;
|
||||
description = ''
|
||||
Workspace symbol search kind.
|
||||
|
@ -1543,7 +1544,7 @@ lib: with lib; {
|
|||
'';
|
||||
};
|
||||
"scope" = mkOption {
|
||||
type = types.nullOr (types.enum [ "workspace" "workspace_and_dependencies" ]);
|
||||
type = types.nullOr (types.enum ["workspace" "workspace_and_dependencies"]);
|
||||
default = null;
|
||||
description = ''
|
||||
Workspace symbol search scope.
|
||||
|
|
|
@ -1,26 +1,30 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.plugins.trouble;
|
||||
helpers = import ../helpers.nix { inherit lib; };
|
||||
in
|
||||
with lib;
|
||||
# with helpers;
|
||||
{
|
||||
options.plugins.trouble = {
|
||||
enable = mkEnableOption "trouble.nvim";
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.plugins.trouble;
|
||||
helpers = import ../helpers.nix {inherit lib;};
|
||||
in
|
||||
with lib;
|
||||
# with helpers;
|
||||
{
|
||||
options.plugins.trouble = {
|
||||
enable = mkEnableOption "trouble.nvim";
|
||||
|
||||
package = helpers.mkPackageOption "trouble-nvim" pkgs.vimPlugins.trouble-nvim;
|
||||
package = helpers.mkPackageOption "trouble-nvim" pkgs.vimPlugins.trouble-nvim;
|
||||
|
||||
position = helpers.mkNullOrOption (types.enum [ "top" "left" "right" "bottom" ]) "Position of the list";
|
||||
height = helpers.mkNullOrOption types.int "Height of the trouble list when position is top or bottom";
|
||||
width = helpers.mkNullOrOption types.int "Width of the trouble list when position is left or right";
|
||||
icons = helpers.mkNullOrOption types.bool "Use devicons for filenames";
|
||||
};
|
||||
position = helpers.mkNullOrOption (types.enum ["top" "left" "right" "bottom"]) "Position of the list";
|
||||
height = helpers.mkNullOrOption types.int "Height of the trouble list when position is top or bottom";
|
||||
width = helpers.mkNullOrOption types.int "Width of the trouble list when position is left or right";
|
||||
icons = helpers.mkNullOrOption types.bool "Use devicons for filenames";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
extraPlugins = with pkgs.vimPlugins; [
|
||||
cfg.package
|
||||
nvim-web-devicons
|
||||
];
|
||||
};
|
||||
}
|
||||
config = mkIf cfg.enable {
|
||||
extraPlugins = with pkgs.vimPlugins; [
|
||||
cfg.package
|
||||
nvim-web-devicons
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue