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
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugins/none-ls/servers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.

withArgs = helpers.mkNullOrStr ''
Raw Lua code passed as an argument to the source's `with` method.
'';
}
Expand Down Expand Up @@ -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}
Expand Down