From 632cf31aba69c8dd1ae7ae5264a7f5a06eb0fc7d Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Wed, 11 Dec 2024 19:15:02 -0300 Subject: [PATCH] plugins/cmp: remove nvim-cmp deprecations warnings These deprecations were introduced in February 2021 with a planned removal in June 2024. These deprecated options have been in place long enough for users to migrate to the new configuration format. --- plugins/cmp/default.nix | 3 - plugins/cmp/deprecations.nix | 361 ----------------------------------- 2 files changed, 364 deletions(-) delete mode 100644 plugins/cmp/deprecations.nix diff --git a/plugins/cmp/default.nix b/plugins/cmp/default.nix index b5fd51a014..9f637c06f6 100644 --- a/plugins/cmp/default.nix +++ b/plugins/cmp/default.nix @@ -55,9 +55,6 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { ''; imports = [ - # Introduced on 2024 February 21 - # TODO: remove ~June 2024 - ./deprecations.nix ./auto-enable.nix ./sources ]; diff --git a/plugins/cmp/deprecations.nix b/plugins/cmp/deprecations.nix deleted file mode 100644 index 2003cbdcb7..0000000000 --- a/plugins/cmp/deprecations.nix +++ /dev/null @@ -1,361 +0,0 @@ -{ lib, ... }: -let - inherit (lib) mkRenamedOptionModule mkRemovedOptionModule; - - 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" - "asyncBudget" - ]; - new = [ - "performance" - "async_budget" - ]; - } - { - old = [ - "performance" - "maxViewEntries" - ]; - new = [ - "performance" - "max_view_entries" - ]; - } - { old = [ "mapping" ]; } - { - old = [ - "completion" - "keywordLength" - ]; - new = [ - "completion" - "keyword_length" - ]; - } - { - old = [ - "completion" - "keywordPattern" - ]; - new = [ - "completion" - "keyword_pattern" - ]; - } - { - old = [ - "completion" - "autocomplete" - ]; - } - { - old = [ - "completion" - "completeopt" - ]; - } - { - old = [ - "confirmation" - "getCommitCharacters" - ]; - new = [ - "confirmation" - "get_commit_characters" - ]; - } - { - old = [ - "formatting" - "expandableIndicator" - ]; - new = [ - "formatting" - "expandable_indicator" - ]; - } - { - old = [ - "formatting" - "fields" - ]; - } - { - old = [ - "formatting" - "format" - ]; - } - { - 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)) - ) 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.`. - 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. - '') - ]; -}