Skip to content

Conversation

@StamesJames
Copy link
Contributor

I have no experience with the lspconfigs, but I saw that the leanls.lua was the only one missing in lsp/ compared to lua/lspconfig/configs/. I simply copied the old settings and migrated them.
This is related to the Issue 427 the lean.nvim repo. I will also write a PR that changes the use of the old require('lspconfig').leanls to vim.lsp.enable and vim.lsp.config but this will only work once the leanls.lua is in lsp/
I tested this PR with an updated lean.nvim plugin already using vim.lsp.enable and vim.lsp.congig and it seems to work.

@StamesJames StamesJames changed the title add: leanls to lsp subdir fix: leanls to lsp subdir Sep 20, 2025
@StamesJames StamesJames force-pushed the add-leanls-to-lsp-subdir branch 2 times, most recently from 650c8bc to 5cb47f2 Compare September 20, 2025 21:36
@StamesJames
Copy link
Contributor Author

I am not sure if I understand the linter message for single_file_support = true, right. As I understood it, this is now true by default, so I discarded it completely from the config.

lsp/leanls.lua Outdated
or vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1])
)
end,
on_new_config = function(config, root_dir)
Copy link
Member

Choose a reason for hiding this comment

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

this is not supported by vim.lsp.config

the top of #3705 mentions a potential way instead: see here.

in this case of lean, it looks like it doesn't even need a custom field on the config, it just needs to define cmd as a function, and then use config.root_dir from the cmd() function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yes I will look into this. I even have read this Issue but than still copied the old config without thinking 😅

@StamesJames StamesJames force-pushed the add-leanls-to-lsp-subdir branch from 5cb47f2 to 71a5616 Compare September 22, 2025 19:17
@StamesJames StamesJames force-pushed the add-leanls-to-lsp-subdir branch from 71a5616 to ef80f9b Compare September 22, 2025 19:19
@StamesJames
Copy link
Contributor Author

Like this, it should now call the cmd with the root_dir as before.

@justinmk
Copy link
Member

Thanks!

@justinmk justinmk merged commit 19273e5 into neovim:master Sep 22, 2025
6 checks passed
@justinmk justinmk changed the title fix: leanls to lsp subdir fix(leanls): migrate to vim.lsp.config Sep 22, 2025
MattSturgeon added a commit to MattSturgeon/nixvim that referenced this pull request Oct 1, 2025
nvim-lspconfig currently doesn't support leanls via the new API,
although this is fixed upstream we don't have the fix in our pinned
nixpkgs yet.

Upstream PR: neovim/nvim-lspconfig#4084
MattSturgeon added a commit to MattSturgeon/nixvim that referenced this pull request Oct 1, 2025
nvim-lspconfig currently doesn't support leanls via the new API,
although this is fixed upstream we don't have the fix in our pinned
nixpkgs yet.

Upstream PR: neovim/nvim-lspconfig#4084
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.

2 participants