Skip to content
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

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

Merged
merged 5 commits into from
Mar 3, 2024

Conversation

robhanlon22
Copy link
Contributor

@robhanlon22 robhanlon22 commented Mar 1, 2024

This was previously null or string, but was changed to null or Lua in #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.

Additionally, there was an errant extra } when interpolating the args, which led to a broken init.lua.

Tested locally, and verified that it fixes my setup.

This was previously null or string, but was changed to null or Lua in
nix-community#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.
@robhanlon22 robhanlon22 changed the title Fix withArgs type plugins/none-ls: fix withArgs type Mar 1, 2024
@robhanlon22 robhanlon22 changed the title plugins/none-ls: fix withArgs type plugins/none-ls: fix withArgs type, syntax Mar 2, 2024
@@ -331,7 +331,7 @@ in {
(source: _:
{
enable = mkEnableOption "the ${source} ${sourceType} source for none-ls";
withArgs = helpers.mkNullOrLua ''
Copy link
Member

Choose a reason for hiding this comment

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

the right type should be helpers.mkNullOrOption helpers.nivimTypes.strLua! Sorry for the issue.

Copy link
Member

Choose a reason for hiding this comment

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

So the type is a "lua string" but we are not converting it to raw right ?

Copy link
Member

Choose a reason for hiding this comment

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

exactly, we pass it directly. We should improve it to take arbitrary lua values with a toLuaObject, but we can do that later.

@robhanlon22
Copy link
Contributor Author

@traxys @GaetanLepage comments addressed!

Copy link
Member

@traxys traxys left a comment

Choose a reason for hiding this comment

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

Sorry for the regression

Copy link
Member

@traxys traxys left a comment

Choose a reason for hiding this comment

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

You are lacking a description, this is why tests are failing

@robhanlon22 robhanlon22 requested a review from traxys March 2, 2024 19:55
@robhanlon22
Copy link
Contributor Author

@traxys d'oh, my bad. Updated

@traxys traxys merged commit 64d3996 into nix-community:main Mar 3, 2024
51 checks passed
@robhanlon22 robhanlon22 deleted the fix-withArgs branch March 3, 2024 22:37
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.

3 participants