1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-13 05:56:08 +01:00

treewide: Reformat with nixfmt

This commit is contained in:
traxys 2024-05-05 19:39:35 +02:00
parent c6281260dc
commit 62f32bfc71
459 changed files with 28139 additions and 26377 deletions

View file

@ -5,18 +5,16 @@
config,
...
}:
with lib; let
with lib;
let
cfg = config.plugins.typescript-tools;
in {
in
{
options.plugins.typescript-tools = {
enable = mkEnableOption "typescript-tools";
package =
helpers.mkPackageOption "typescript-tools"
pkgs.vimPlugins.typescript-tools-nvim;
package = helpers.mkPackageOption "typescript-tools" pkgs.vimPlugins.typescript-tools-nvim;
onAttach =
helpers.defaultNullOpts.mkLuaFn "__lspOnAttach"
"Lua code to run when tsserver attaches to a buffer.";
onAttach = helpers.defaultNullOpts.mkLuaFn "__lspOnAttach" "Lua code to run when tsserver attaches to a buffer.";
handlers = mkOption {
type = with helpers.nixvimTypes; nullOr (attrsOf strLuaFn);
apply = v: helpers.ifNonNull' v (mapAttrs (_: helpers.mkRaw) v);
@ -33,27 +31,33 @@ in {
};
settings = {
separateDiagnosticServer =
helpers.defaultNullOpts.mkBool true
"Spawns an additional tsserver instance to calculate diagnostics";
separateDiagnosticServer = helpers.defaultNullOpts.mkBool true "Spawns an additional tsserver instance to calculate diagnostics";
publishDiagnosticOn =
helpers.defaultNullOpts.mkEnum ["change" "insert_leave"]
"insert_leave" ''
Either "change" or "insert_leave". Determines when the client asks the server about diagnostics
'';
helpers.defaultNullOpts.mkEnum
[
"change"
"insert_leave"
]
"insert_leave"
''
Either "change" or "insert_leave". Determines when the client asks the server about diagnostics
'';
exposeAsCodeAction = mkOption {
type = with types;
either (enum ["all"]) (listOf (enum [
"fix_all"
"add_missing_imports"
"remove_unused"
"remove_unused_imports"
"organize_imports"
"insert_leave"
]));
default = [];
type =
with types;
either (enum [ "all" ]) (
listOf (enum [
"fix_all"
"add_missing_imports"
"remove_unused"
"remove_unused_imports"
"organize_imports"
"insert_leave"
])
);
default = [ ];
description = "Specify what to expose as code actions.";
};
@ -62,17 +66,19 @@ in {
doesn't exist then standard path resolution strategy is applied
'';
tsserverPlugins = with helpers.nixvimTypes;
tsserverPlugins =
with helpers.nixvimTypes;
helpers.mkNullOrOption (listOf (maybeRaw str)) ''
List of plugins for tsserver to load. See this plugins's README
at https://github.com/pmizio/typescript-tools.nvim/#-styled-components-support
'';
tsserverMaxMemory = helpers.mkNullOrOption (with helpers.nixvimTypes;
maybeRaw (either ints.unsigned (enum ["auto"]))) ''
This value is passed to: https://nodejs.org/api/cli.html#--max-old-space-sizesize-in-megabytes
Memory limit in megabytes or "auto"(basically no limit)
'';
tsserverMaxMemory =
helpers.mkNullOrOption (with helpers.nixvimTypes; maybeRaw (either ints.unsigned (enum [ "auto" ])))
''
This value is passed to: https://nodejs.org/api/cli.html#--max-old-space-sizesize-in-megabytes
Memory limit in megabytes or "auto"(basically no limit)
'';
tsserverFormatOptions = mkOption {
type = with types; nullOr (attrsOf anything);
@ -117,13 +123,15 @@ in {
'';
codeLens =
helpers.defaultNullOpts.mkEnum [
helpers.defaultNullOpts.mkEnum
[
"off"
"all"
"implementations_only"
"references_only"
]
"off"
"all"
"implementations_only"
"references_only"
] "off"
"WARNING: Experimental feature also in VSCode, disabled by default because it might impact server performance.";
"WARNING: Experimental feature also in VSCode, disabled by default because it might impact server performance.";
disableMemberCodeLens = helpers.defaultNullOpts.mkBool true ''
By default code lenses are displayed on all referenceable values. Display less by removing member references from lenses.
@ -133,11 +141,9 @@ in {
enable = helpers.defaultNullOpts.mkBool false ''
Functions similarly to `nvim-ts-autotag`. This is disabled by default to avoid conflicts.
'';
filetypes =
helpers.defaultNullOpts.mkListOf types.str
''["javascriptreact" "typescriptreact"]'' ''
Filetypes this should apply to.
'';
filetypes = helpers.defaultNullOpts.mkListOf types.str ''["javascriptreact" "typescriptreact"]'' ''
Filetypes this should apply to.
'';
};
};
};
@ -148,31 +154,35 @@ in {
nvim-lspconfig
];
plugins.lsp.postConfig = with cfg; let
options = {
inherit handlers;
on_attach = onAttach;
plugins.lsp.postConfig =
with cfg;
let
options = {
inherit handlers;
on_attach = onAttach;
settings = with settings; {
separate_diagnostic_server = separateDiagnosticServer;
publish_diagnostic_on = publishDiagnosticOn;
expose_as_code_action = exposeAsCodeAction;
tsserver_path = tsserverPath;
tsserver_plugins = tsserverPlugins;
tsserver_max_memory = tsserverMaxMemory;
tsserver_format_options = tsserverFormatOptions;
tsserver_file_preferences = tsserverFilePreferences;
tsserver_locale = tsserverLocale;
complete_function_calls = completeFunctionCalls;
include_completions_with_insert_text =
includeCompletionsWithInsertText;
code_lens = codeLens;
disable_member_code_lens = disableMemberCodeLens;
jsx_close_tag = with jsxCloseTag; {inherit enable filetypes;};
settings = with settings; {
separate_diagnostic_server = separateDiagnosticServer;
publish_diagnostic_on = publishDiagnosticOn;
expose_as_code_action = exposeAsCodeAction;
tsserver_path = tsserverPath;
tsserver_plugins = tsserverPlugins;
tsserver_max_memory = tsserverMaxMemory;
tsserver_format_options = tsserverFormatOptions;
tsserver_file_preferences = tsserverFilePreferences;
tsserver_locale = tsserverLocale;
complete_function_calls = completeFunctionCalls;
include_completions_with_insert_text = includeCompletionsWithInsertText;
code_lens = codeLens;
disable_member_code_lens = disableMemberCodeLens;
jsx_close_tag = with jsxCloseTag; {
inherit enable filetypes;
};
};
};
};
in ''
require('typescript-tools').setup(${helpers.toLuaObject options})
'';
in
''
require('typescript-tools').setup(${helpers.toLuaObject options})
'';
};
}