plugins/none-ls: fix withArgs type, syntax (#1182)

This was previously null or string, but was changed to null or Lua in
nix-community/nixvim#1169. Internally, `withArgs` is expected to be a
string, but `mkNullOrLua` applies `mkRaw`, leading to a type error when
generating the output, as it is attempting to interpolate a set rather
than a string.

Tested locally, and verified that it fixes my setup.
This commit is contained in:
Rob Hanlon 2024-03-03 02:39:13 -08:00 committed by GitHub
parent cd86fd1e58
commit 64d3996bd0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -331,7 +331,7 @@ in {
(source: _:
{
enable = mkEnableOption "the ${source} ${sourceType} source for none-ls";
withArgs = helpers.mkNullOrLua ''
withArgs = helpers.mkNullOrOption helpers.nixvimTypes.strLua ''
Raw Lua code passed as an argument to the source's `with` method.
'';
}
@ -383,7 +383,7 @@ in {
withArgs =
if source.withArgs == null
then sourceItem
else "${sourceItem}.with(${source.withArgs}})";
else "${sourceItem}.with(${source.withArgs})";
in
helpers.mkRaw ''
require("null-ls").builtins.${withArgs}