modules/keymap: improve lua deprecation#2035
Merged
MattSturgeon merged 1 commit intonix-community:mainfrom Aug 18, 2024
Merged
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This was referenced Aug 18, 2024
45c9d38 to
42a3128
Compare
42a3128 to
88bfa9c
Compare
khaneliman
approved these changes
Aug 18, 2024
Contributor
khaneliman
left a comment
There was a problem hiding this comment.
Feels weird that the merge would be completely ignored, resulting in needing to apply in every consumer of a function. But, in lieu of a better alternative it makes sense to me, for now.
With the conversation around #1935 will this be another place we have a migration away from recommending __raw
5 tasks
88bfa9c to
f291c40
Compare
Member
Author
I don't fully understand it either, we had the same issue implementing My best guess is something in |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
- Replace nullable lua option with a no-default option. - Made it so the deprecated option is only declared when `lua = true` is passed. - Replace `normalizeMappings` with a `removeDeprecatedMapAttrs` helper. - Added warnings for all options that historically had `lua` support.
f291c40 to
7fb1f9d
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lua = trueis passed.normalizeMappingswith aremoveDeprecatedMapAttrshelper.luasupport.This supersedes and closes #1795
Removing the attr from the final value
I'd like to do something like this directly in
mkMapOptionSubmodule, however it doesn't seem to do what you'd expect...Therefore I've instead added
applyfunctions to each keymap option that removes theluaattr.See this message on matrix.
Showing the warning for all uses
Previously, we only checked the
keymapsoption in our deprecation warning.We could instead have a
lib.warnin theaction'sapplyfunction when we callmkRaw, however this wouldn't have access tolocordefsto print a proper warning.If overriding the
mergefunction worked correctly, we could do it there, however I think this is fine for this PR, we can always improve things further in future work.For now,
modules/keymaps.nixis responsible for showing warnings for all options that previously had aluasub-option.