neovim/lsp: expose low-level API
- lib/languages: add
lspOptionssubmodule type for freeform LSP config - lib/languages: add
root_markertolspOptionstype - neovim/lsp: init
- lib/languages: add explicit enable to LSP submodule
- lib/lua: deprecate old Lua helpers superseded by
toLuaObject
This exposes a low(er) level API for configuring LSPs directly with the new options provided by Neovim 0.11. The idea is to allow configuring LSPs without relying on the inclusion of language modules into nvf, or allowing language modules in user configurations.
The language modules still use the old API, and will be migrated in due time. Changes here are split off to avoid withholding important additions to the module system until all language modules are converted. Language modules, of course, will still need to be converted to this new API, after which lspconfig shall be made into a regular plugin module instead of its current, specially treated "variant."
Related: https://github.com/NotAShelf/nvf/discussions/748
:rocket: Live preview deployed from 3147ef13711464ec555f8897c1179c55ca76ec77
View it here:
Debug Information
Triggered by: horriblename
HEAD at: lsp-api
Reruns: 747
✅ Preview has been deleted successfully!
Note: this breaks if you're not on neovim 0.11.0+ as vim.lsp.config wasn't introduced until then.
I found it as I'm on nix-stable-24.11 until 25.05 comes out, and that has neovim v0.10.2 still.
Error from today:
Error detected while processing VIMINIT..script /nix/store/n3l1rbdiznj7scgmlmfw7ixkpgjvjpnv-neovim-pack-dir/init.lua:
E5113: Error while calling lua chunk: /nix/store/3z4gd16qap9d9v8syz51qlnisy3gij5i-init.lua:435: attempt to index field 'config' (a nil value)
stack traceback:
/nix/store/3z4gd16qap9d9v8syz51qlnisy3gij5i-init.lua:435: in main chunk
[C]: in function 'dofile'
...3l1rbdiznj7scgmlmfw7ixkpgjvjpnv-neovim-pack-dir/init.lua:13: in main chunk
Press ENTER or type command to continue
neovim version:
❯ nvim -V1 -v
NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1713773202
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "
/nix/store/wswwc2v8xkcksy1sym3kyw01ynvw0947-neovim-unwrapped-0.10.2/share/nvim
"
Run :checkhealth for more info
Please do not override nvf's nixpkgs version. I know this can be (and should be) communicated better, but we only target nixpkgs unstable since we do not have the manpower to divert energy to supporting the stable branch. You can remove the follows line, and it should work as intended.