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

[BUG] plugins.lsp.*.filetypes should be nil-able #2361

Open
1 task done
meck opened this issue Oct 4, 2024 · 2 comments
Open
1 task done

[BUG] plugins.lsp.*.filetypes should be nil-able #2361

meck opened this issue Oct 4, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@meck
Copy link

meck commented Oct 4, 2024

Field Description
Plugin All LSP Plugins
Nixpkgs unstable
Home Manager unstable
  • I have read the FAQ and my bug is not listed there.

Description

plugins.lsp.*.filestypes should be able to generate a nil lua value, currently any null value is filtered out, falling back to nvim-lspconfig default value which makes sense. However to activate a lsp for any filetype this should be forced to nil.

The scenario I'm looking at is enabling ltex-ls for all files (with autostart = false) and starting it manually using LspStart where needed. I don't know if an empty list should be transformed to nil or the rawLua type should just be enabled as possible type?

@meck meck added the bug Something isn't working label Oct 4, 2024
@MattSturgeon
Copy link
Member

This is a bit more of a general issue in nixvim. Our to-lua generator currently assumes that null-or-empty value should not be rendered as lua.

There's a few historical reasons for this, but it leads to frustration in cases like this where we actually want to include a nil or a {} in the output...

@MattSturgeon
Copy link
Member

One workaround is to use our "raw lua" feature:

{
  foo.__raw = "nil";
  bar.__raw = "{}";
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants