Skip to content

Conversation

axelkar
Copy link
Member

@axelkar axelkar commented Oct 4, 2025

Comment on lines +44 to +45
defaultNullOpts.mkListOf types.str
(lib.nixvim.literalLua "{ vim.fn.stdpath('config') .. '/snippets' }")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Member Author

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 pluginDefaults, they would be broken by this PR. I'll turn this into a draft PR.

Copy link
Member

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.

Copy link
Member

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 "{ ... }"

Copy link
Member Author

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.

@axelkar axelkar marked this pull request as draft October 4, 2025 21:38
@axelkar axelkar marked this pull request as ready for review October 5, 2025 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants