-
-
Notifications
You must be signed in to change notification settings - Fork 349
treewide(docs): use literalLua instead of __raw in option examples #3776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
defaultNullOpts.mkListOf types.str | ||
(lib.nixvim.literalLua "{ vim.fn.stdpath('config') .. '/snippets' }") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaultNullOpts.mkListOf types.str | |
(lib.nixvim.literalLua "{ vim.fn.stdpath('config') .. '/snippets' }") | |
defaultNullOpts.mkListOf types.str | |
[ (lib.nixvim.literalLua "vim.fn.stdpath('config') .. '/snippets'" ]) |
mkListOf types.str
options allow __raw
elements by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no __raw
there anymore, that argument is only for documentation. The whole goal of this PR is to get rid of __raw
because it doesn't render well. Another way to do this would be to pipe __raw
to literalLua
in pluginDefault
.
Actually, if we were to start making the default config checks automatically based on pluginDefault
s, they would be broken by this PR. I'll turn this into a draft PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, if we were to start making the default config checks automatically based on pluginDefaults, they would be broken by this PR. I'll turn this into a draft PR.
There's no need to block this PR on tangential or unrelated refactoring.
pluginDefault
is purely for documentation. There are no plans to use it for generating tests.
Feel free to undraft.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GaetanLepage 's suggestion of [ (lib.nixvim.literalLua "vim.fn.stdpath('config') .. '/snippets'" ])
won't work, because it's embedding a literalExpression within a value.
You could do any of:
# I think this is what Gaétan meant:
[ (nestedLiteralLua "...") ]
# This is the least "magic":
literalExpression ''[ (lib.nixvim.mkRaw "...") ]''
# This has a disadvantage of not demonstrating how list items can be raw values:
literalLua "{ ... }"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need to block this PR on tangential or unrelated refactoring.
pluginDefault
is purely for documentation. There are no plans to use it for generating tests.Feel free to undraft.
Great! I thought that was the reason @GaetanLepage suggested a list at the top level.
See #3076 (comment)