mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-16 04:04:34 +02:00
treewide: Reformat with nixfmt
This commit is contained in:
parent
c6281260dc
commit
62f32bfc71
459 changed files with 28139 additions and 26377 deletions
|
@ -1,164 +1,360 @@
|
|||
{lib, ...}:
|
||||
with lib; let
|
||||
oldPluginBasePath = ["plugins" "nvim-cmp"];
|
||||
newPluginBasePath = ["plugins" "cmp"];
|
||||
settingsPath = newPluginBasePath ++ ["settings"];
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
oldPluginBasePath = [
|
||||
"plugins"
|
||||
"nvim-cmp"
|
||||
];
|
||||
newPluginBasePath = [
|
||||
"plugins"
|
||||
"cmp"
|
||||
];
|
||||
settingsPath = newPluginBasePath ++ [ "settings" ];
|
||||
|
||||
renamedOptions = [
|
||||
{old = ["performance" "debounce"];}
|
||||
{old = ["performance" "throttle"];}
|
||||
{
|
||||
old = ["performance" "fetchingTimeout"];
|
||||
new = ["performance" "fetching_timeout"];
|
||||
old = [
|
||||
"performance"
|
||||
"debounce"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = ["performance" "asyncBudget"];
|
||||
new = ["performance" "async_budget"];
|
||||
old = [
|
||||
"performance"
|
||||
"throttle"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = ["performance" "maxViewEntries"];
|
||||
new = ["performance" "max_view_entries"];
|
||||
}
|
||||
{old = ["mapping"];}
|
||||
{
|
||||
old = ["completion" "keywordLength"];
|
||||
new = ["completion" "keyword_length"];
|
||||
old = [
|
||||
"performance"
|
||||
"fetchingTimeout"
|
||||
];
|
||||
new = [
|
||||
"performance"
|
||||
"fetching_timeout"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = ["completion" "keywordPattern"];
|
||||
new = ["completion" "keyword_pattern"];
|
||||
}
|
||||
{old = ["completion" "autocomplete"];}
|
||||
{old = ["completion" "completeopt"];}
|
||||
{
|
||||
old = ["confirmation" "getCommitCharacters"];
|
||||
new = ["confirmation" "get_commit_characters"];
|
||||
old = [
|
||||
"performance"
|
||||
"asyncBudget"
|
||||
];
|
||||
new = [
|
||||
"performance"
|
||||
"async_budget"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = ["formatting" "expandableIndicator"];
|
||||
new = ["formatting" "expandable_indicator"];
|
||||
old = [
|
||||
"performance"
|
||||
"maxViewEntries"
|
||||
];
|
||||
new = [
|
||||
"performance"
|
||||
"max_view_entries"
|
||||
];
|
||||
}
|
||||
{old = ["formatting" "fields"];}
|
||||
{old = ["formatting" "format"];}
|
||||
{ old = [ "mapping" ]; }
|
||||
{
|
||||
old = ["matching" "disallowFuzzyMatching"];
|
||||
new = ["matching" "disallow_fuzzy_matching"];
|
||||
old = [
|
||||
"completion"
|
||||
"keywordLength"
|
||||
];
|
||||
new = [
|
||||
"completion"
|
||||
"keyword_length"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = ["matching" "disallowFullfuzzyMatching"];
|
||||
new = ["matching" "disallow_fullfuzzy_matching"];
|
||||
old = [
|
||||
"completion"
|
||||
"keywordPattern"
|
||||
];
|
||||
new = [
|
||||
"completion"
|
||||
"keyword_pattern"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = ["matching" "disallowPartialFuzzyMatching"];
|
||||
new = ["matching" "disallow_partial_fuzzy_matching"];
|
||||
old = [
|
||||
"completion"
|
||||
"autocomplete"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = ["matching" "disallowPartialMatching"];
|
||||
new = ["matching" "disallow_partial_matching"];
|
||||
old = [
|
||||
"completion"
|
||||
"completeopt"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = ["matching" "disallowPrefixUnmatching"];
|
||||
new = ["matching" "disallow_prefix_unmatching"];
|
||||
old = [
|
||||
"confirmation"
|
||||
"getCommitCharacters"
|
||||
];
|
||||
new = [
|
||||
"confirmation"
|
||||
"get_commit_characters"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = ["sorting" "priorityWeight"];
|
||||
new = ["sorting" "priority_weight"];
|
||||
}
|
||||
{old = ["view" "entries"];}
|
||||
{
|
||||
old = ["view" "docs" "autoOpen"];
|
||||
new = ["view" "docs" "auto_open"];
|
||||
}
|
||||
{old = ["window" "completion" "border"];}
|
||||
{old = ["window" "completion" "winhighlight"];}
|
||||
{old = ["window" "completion" "zindex"];}
|
||||
{old = ["window" "completion" "scrolloff"];}
|
||||
{
|
||||
old = ["window" "completion" "colOffset"];
|
||||
new = ["window" "completion" "col_offset"];
|
||||
old = [
|
||||
"formatting"
|
||||
"expandableIndicator"
|
||||
];
|
||||
new = [
|
||||
"formatting"
|
||||
"expandable_indicator"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = ["window" "completion" "sidePadding"];
|
||||
new = ["window" "completion" "side_padding"];
|
||||
}
|
||||
{old = ["window" "completion" "scrollbar"];}
|
||||
{old = ["window" "documentation" "border"];}
|
||||
{old = ["window" "documentation" "winhighlight"];}
|
||||
{old = ["window" "documentation" "zindex"];}
|
||||
{
|
||||
old = ["window" "documentation" "maxWidth"];
|
||||
new = ["window" "documentation" "max_width"];
|
||||
old = [
|
||||
"formatting"
|
||||
"fields"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = ["window" "documentation" "maxHeight"];
|
||||
new = ["window" "documentation" "max_height"];
|
||||
old = [
|
||||
"formatting"
|
||||
"format"
|
||||
];
|
||||
}
|
||||
{old = ["experimental"];}
|
||||
{
|
||||
old = [
|
||||
"matching"
|
||||
"disallowFuzzyMatching"
|
||||
];
|
||||
new = [
|
||||
"matching"
|
||||
"disallow_fuzzy_matching"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"matching"
|
||||
"disallowFullfuzzyMatching"
|
||||
];
|
||||
new = [
|
||||
"matching"
|
||||
"disallow_fullfuzzy_matching"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"matching"
|
||||
"disallowPartialFuzzyMatching"
|
||||
];
|
||||
new = [
|
||||
"matching"
|
||||
"disallow_partial_fuzzy_matching"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"matching"
|
||||
"disallowPartialMatching"
|
||||
];
|
||||
new = [
|
||||
"matching"
|
||||
"disallow_partial_matching"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"matching"
|
||||
"disallowPrefixUnmatching"
|
||||
];
|
||||
new = [
|
||||
"matching"
|
||||
"disallow_prefix_unmatching"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"sorting"
|
||||
"priorityWeight"
|
||||
];
|
||||
new = [
|
||||
"sorting"
|
||||
"priority_weight"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"view"
|
||||
"entries"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"view"
|
||||
"docs"
|
||||
"autoOpen"
|
||||
];
|
||||
new = [
|
||||
"view"
|
||||
"docs"
|
||||
"auto_open"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"window"
|
||||
"completion"
|
||||
"border"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"window"
|
||||
"completion"
|
||||
"winhighlight"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"window"
|
||||
"completion"
|
||||
"zindex"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"window"
|
||||
"completion"
|
||||
"scrolloff"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"window"
|
||||
"completion"
|
||||
"colOffset"
|
||||
];
|
||||
new = [
|
||||
"window"
|
||||
"completion"
|
||||
"col_offset"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"window"
|
||||
"completion"
|
||||
"sidePadding"
|
||||
];
|
||||
new = [
|
||||
"window"
|
||||
"completion"
|
||||
"side_padding"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"window"
|
||||
"completion"
|
||||
"scrollbar"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"window"
|
||||
"documentation"
|
||||
"border"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"window"
|
||||
"documentation"
|
||||
"winhighlight"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"window"
|
||||
"documentation"
|
||||
"zindex"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"window"
|
||||
"documentation"
|
||||
"maxWidth"
|
||||
];
|
||||
new = [
|
||||
"window"
|
||||
"documentation"
|
||||
"max_width"
|
||||
];
|
||||
}
|
||||
{
|
||||
old = [
|
||||
"window"
|
||||
"documentation"
|
||||
"maxHeight"
|
||||
];
|
||||
new = [
|
||||
"window"
|
||||
"documentation"
|
||||
"max_height"
|
||||
];
|
||||
}
|
||||
{ old = [ "experimental" ]; }
|
||||
];
|
||||
|
||||
renameWarnings =
|
||||
map
|
||||
(
|
||||
rename:
|
||||
mkRenamedOptionModule
|
||||
(oldPluginBasePath ++ rename.old)
|
||||
(settingsPath ++ (rename.new or rename.old))
|
||||
renameWarnings = map (
|
||||
rename:
|
||||
mkRenamedOptionModule (oldPluginBasePath ++ rename.old) (settingsPath ++ (rename.new or rename.old))
|
||||
) renamedOptions;
|
||||
in
|
||||
{
|
||||
imports = renameWarnings ++ [
|
||||
(mkRenamedOptionModule (oldPluginBasePath ++ [ "enable" ]) (newPluginBasePath ++ [ "enable" ]))
|
||||
(mkRenamedOptionModule (oldPluginBasePath ++ [ "autoEnableSources" ]) (
|
||||
newPluginBasePath ++ [ "autoEnableSources" ]
|
||||
))
|
||||
(mkRemovedOptionModule (oldPluginBasePath ++ [ "preselect" ]) ''
|
||||
Use `plugins.cmp.settings.preselect` option. But watch out, you now have to explicitly write `cmp.PreselectMode.<mode>`.
|
||||
See the option documentation for more details.
|
||||
'')
|
||||
(mkRemovedOptionModule (oldPluginBasePath ++ [ "mappingPresets" ])
|
||||
"If you want to have a complex mapping logic, express it in raw lua within the `plugins.cmp.settings.mapping` option."
|
||||
)
|
||||
renamedOptions;
|
||||
in {
|
||||
imports =
|
||||
renameWarnings
|
||||
++ [
|
||||
(mkRemovedOptionModule
|
||||
(
|
||||
mkRenamedOptionModule
|
||||
(oldPluginBasePath ++ ["enable"])
|
||||
(newPluginBasePath ++ ["enable"])
|
||||
oldPluginBasePath
|
||||
++ [
|
||||
"snippet"
|
||||
"expand"
|
||||
]
|
||||
)
|
||||
''
|
||||
Use `plugins.cmp.settings.snippet.expand` option. But watch out, you can no longer put only the name of the snippet engine.
|
||||
If you use `luasnip` for instance, set:
|
||||
```
|
||||
plugins.cmp.settings.snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
|
||||
```
|
||||
''
|
||||
)
|
||||
(mkRemovedOptionModule
|
||||
(
|
||||
mkRenamedOptionModule
|
||||
(oldPluginBasePath ++ ["autoEnableSources"])
|
||||
(newPluginBasePath ++ ["autoEnableSources"])
|
||||
oldPluginBasePath
|
||||
++ [
|
||||
"sorting"
|
||||
"comparators"
|
||||
]
|
||||
)
|
||||
(
|
||||
mkRemovedOptionModule
|
||||
(oldPluginBasePath ++ ["preselect"])
|
||||
''
|
||||
Use `plugins.cmp.settings.preselect` option. But watch out, you now have to explicitly write `cmp.PreselectMode.<mode>`.
|
||||
See the option documentation for more details.
|
||||
''
|
||||
)
|
||||
(
|
||||
mkRemovedOptionModule
|
||||
(oldPluginBasePath ++ ["mappingPresets"])
|
||||
"If you want to have a complex mapping logic, express it in raw lua within the `plugins.cmp.settings.mapping` option."
|
||||
)
|
||||
(
|
||||
mkRemovedOptionModule
|
||||
(oldPluginBasePath ++ ["snippet" "expand"])
|
||||
''
|
||||
Use `plugins.cmp.settings.snippet.expand` option. But watch out, you can no longer put only the name of the snippet engine.
|
||||
If you use `luasnip` for instance, set:
|
||||
```
|
||||
plugins.cmp.settings.snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
|
||||
```
|
||||
''
|
||||
)
|
||||
(
|
||||
mkRemovedOptionModule
|
||||
(oldPluginBasePath ++ ["sorting" "comparators"])
|
||||
''
|
||||
Use `plugins.cmp.settings.sorting.comparators` option. But watch out, you can no longer put only the name of the comparators.
|
||||
See the option documentation for more details.
|
||||
''
|
||||
)
|
||||
(
|
||||
mkRemovedOptionModule
|
||||
(oldPluginBasePath ++ ["sources"])
|
||||
''
|
||||
Use `plugins.cmp.settings.sources` option. But watch out, you can no longer provide a list of lists of sources.
|
||||
For this type of use, directly write lua.
|
||||
See the option documentation for more details.
|
||||
''
|
||||
)
|
||||
];
|
||||
''
|
||||
Use `plugins.cmp.settings.sorting.comparators` option. But watch out, you can no longer put only the name of the comparators.
|
||||
See the option documentation for more details.
|
||||
''
|
||||
)
|
||||
(mkRemovedOptionModule (oldPluginBasePath ++ [ "sources" ]) ''
|
||||
Use `plugins.cmp.settings.sources` option. But watch out, you can no longer provide a list of lists of sources.
|
||||
For this type of use, directly write lua.
|
||||
See the option documentation for more details.
|
||||
'')
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue