modules/keymaps: fix lua option deprecation warning#3960
modules/keymaps: fix lua option deprecation warning#3960GaetanLepage merged 1 commit intonix-community:mainfrom
lua option deprecation warning#3960Conversation
The deprecation warning for the keymap-submocule `lua` option relied on `getSubOptions`, however this is fundamentally flawed because that function returns uses a different module eval from the one that merges submodule definitions. Since definitions are not used by `getSubOptions`, `options.lua.isDefined` will never be true. Instead, we have two choices: 1. Add a `luaIsDefined` option to the keymap submodule 2. Use the new v2 merge's `valueMeta` to access the actual module eval
|
~` Getting this error when updating nixvim, feel like this error has something to do with this change |
|
Thanks for reporting! Do you have a really old nixpkgs revision somewhere? If We can handle that edge-case better, though 🤔 |
I've just updated my flake inputs and got the same error for latest both stable and unstable nixpkgs |
|
Same here, In my case, Nixvim is following NixOS-Unstable branch of the NixPkgs. Maybe the ValueMeta update hasn't made it way into downstream NixOS-Unstable branch? |
The deprecation warning for the keymap-submocule
luaoption relied ongetSubOptions, however this is fundamentally flawed because that function uses a different module eval from the one that merges submodule definitions.Since definitions are not used by
getSubOptions,options.lua.isDefinedwill never be true.Instead, we have two choices:
luaIsDefinedoption to the keymap submodulevalueMetato access the actual module evalIn this PR I've implemented option 2, and added tests to ensure the warning actually works. Actually testing that warnings and deprecated options work as expected is important, as demonstrated by this one being broken so long without us noticing.
Since the warning will not have been shown to any users, I've pushed back the "will be removed after" epoch. (Sadly, I started working on this because I was hoping to delete all the deprecated
luaoption code... Then I noticed it was fundamentally flawed).