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

@ -1,12 +1,10 @@
{
lib,
config,
...
}:
with lib; let
{ lib, config, ... }:
with lib;
let
cfg = config.plugins.none-ls.sources.formatting.prettier;
tsserver-cfg = config.plugins.lsp.servers.tsserver;
in {
in
{
options.plugins.none-ls.sources.formatting.prettier = {
disableTsServerFormatter = mkOption {
type = with types; nullOr bool;
@ -19,33 +17,27 @@ in {
};
config = mkIf cfg.enable {
warnings =
optional
(
(cfg.disableTsServerFormatter == null)
&& tsserver-cfg.enable
)
''
You have enabled the `prettier` formatter in none-ls.
You have also enabled the `tsserver` language server which also brings a formatting feature.
warnings = optional ((cfg.disableTsServerFormatter == null) && tsserver-cfg.enable) ''
You have enabled the `prettier` formatter in none-ls.
You have also enabled the `tsserver` language server which also brings a formatting feature.
- To disable the formatter built-in the `tsserver` language server, set
`plugins.none-ls.sources.formatting.prettier.disableTsServerFormatter` to `true`.
- Else, to silence this warning, explicitly set the option to `false`.
'';
- To disable the formatter built-in the `tsserver` language server, set
`plugins.none-ls.sources.formatting.prettier.disableTsServerFormatter` to `true`.
- Else, to silence this warning, explicitly set the option to `false`.
'';
plugins.lsp.servers.tsserver =
mkIf
(
cfg.enable
&& tsserver-cfg.enable
&& (isBool cfg.disableTsServerFormatter)
&& cfg.disableTsServerFormatter
)
{
onAttach.function = ''
client.server_capabilities.documentFormattingProvider = false
'';
};
(
cfg.enable
&& tsserver-cfg.enable
&& (isBool cfg.disableTsServerFormatter)
&& cfg.disableTsServerFormatter
)
{
onAttach.function = ''
client.server_capabilities.documentFormattingProvider = false
'';
};
};
}