Skip to content

fix(lean)!: update lean.nvim config for v2026.4.1+ (setup() was removed) - #1810

Open
srghma wants to merge 1 commit into
AstroNvim:mainfrom
srghma:srghma/update-pack-lean
Open

srghma wants to merge 1 commit into
AstroNvim:mainfrom
srghma:srghma/update-pack-lean

Conversation

@srghma

@srghma srghma commented Nov 18, 2026

Copy link
Copy Markdown

Description

Updated astrocommunity.pack.lean to match lean.nvim's breaking configuration and LSP changes ✨

What changed

  • 🔄 Switched from setup() to vim.g.lean_config: In Julian/lean.nvim (ca4393dc, 2026-10-04, post-v2026.4.1 main), require("lean").setup() was removed, causing lazy.nvim to crash on .lean files with:
    attempt to call field 'setup' (a nil value)
  • 🧩 Preserved opts merging via init + no-op config:
    • lazy.nvim runs packadd (which sources plugin/lean.lua → lean.init() → require("lean.config")()) before config(). Setting vim.g.lean_config in init ensures user opts are already loaded when plugin/lean.lua evaluates lsp.enable.
    • Adding config = function() end prevents lazy.nvim from calling the removed require("lean").setup(opts).
  • ⚡ Changed lazy-load trigger from ft = { "lean" } to event = { "BufReadPre *.lean", "BufNewFile *.lean" }: Matches lean.nvim's recommended setup (927f8485) so plugin/lean.lua enables leanls before FileType lean fires on the first opened buffer.
  • 🧹 Removed obsolete lsp.on_attach: lean.nvim removed nvim-lspconfig and lsp.on_attach (4f62922d, v2026.4.1) in favor of native lsp/leanls.lua + vim.lsp.enable("leanls"), which inherits AstroLSP's vim.lsp.config["*"] automatically.

Additional Information

  • ⚠️ Breaking change: Targets lean.nvim at or after ca4393dc (post-v2026.4.1 main). Users pinned to older lean.nvim versions that still require lean.setup() will need to update the plugin.
  • ✅ Verified with Neovim 0.12.6, AstroNvim, lean.nvim (5f75941), and selene.

lean.nvim removed require('lean').setup() (ca4393dc, post-v2026.4.1) and lsp.on_attach (4f62922d, v2026.4.1), switching to vim.g.lean_config and native vim.lsp.enable('leanls').

BREAKING CHANGE: Requires lean.nvim at or after ca4393dc (post-v2026.4.1 main); users pinned to older versions must update lean.nvim.
@github-actions

Copy link
Copy Markdown

Review Checklist

Does this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist:

Proper conventional commit scoping:

  • If you are adding a new plugin, the scope would be the name of the category it is being added into. ex. feat(utility): added noice.nvim plugin

  • If you are modifying a pre-existing plugin or pack, the scope would be the name of the plugin folder. ex. fix(noice-nvim): fix LSP handler error

  • Pull request title has the appropriate conventional commit type and scope where the scope is the name of the pre-existing directory in the project as described above

  • README is properly formatted and uses fenced in links with <url> unless they are inside a [title](url)

  • Entry returns a single plugin spec with the new plugin as the only top level spec (not applicable for recipes or packs).

  • Proper usage of opts table rather than setting things up with the config function.

  • Proper usage of specs table for all specs that are not dependencies of a given plugin (not applicable for recipes or packs).

This branch has not been deployed

No deployments
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.

1 participant