61 Commits
Author SHA1 Message Date
Max KoonandMatt Sturgeon 94fa51d8b7 modules/lsp: updated inlayHints option description 2026-08-17 11:45:24 +00:00
Max KoonandMatt Sturgeon 73a1c2ef73 modules/lsp: added codelens option 2026-08-17 11:45:24 +00:00
Gaetan Lepage 902dd3995b modules/lsp: update server packages 2026-08-10 15:46:33 +00:00
Austin Horstman 1b436e6a65 modules/lsp/servers: document common configurations
Add primary-source-backed examples for common servers whose configuration shape is easy to get wrong.
2026-07-29 20:19:54 +00:00
Austin Horstman 4966920244 modules/lsp/servers: document tinymist configuration
Add Tinymist-specific guidance and verify rendered option metadata while preserving generic server fallbacks.
2026-07-29 20:19:54 +00:00
Austin Horstman 2633ab9f52 modules/lsp/servers: support documentation overrides
Allow generated server options to accept per-server descriptions and submodule arguments without changing existing package data.
2026-07-29 20:19:54 +00:00
Austin Horstman 157cbcb47b modules/lsp/packages: map newly packaged servers
Move servers from unpackaged list to direct nixpkgs packages where
binary names are now available so auto-install can resolve them.
2026-06-16 19:23:42 +00:00
Austin Horstman 1d91fc6f88 modules/lsp/packages: add dexter packaged 2026-06-15 19:17:02 +00:00
Matt SturgeonandAustin Horstman 55ae671d68 modules/lsp/packages: update unpackaged LSPs
No effort was made to check if any of these _are_ packaged.
2026-06-15 19:17:02 +00:00
Corbin WunderlichandMatt Sturgeon 98acb923e5 lsp/servers/packages: add package for prismals
A package for prisma-language-server was added in nixpkgs with
NixOS/nixpkgs#444038
2026-06-07 16:25:25 +00:00
Diogo Correiaandtraxys 2109e94081 lsp/servers/packages: add package for phpantom_lsp
The phpantom-lsp package is available in nixpkgs
since https://github.com/NixOS/nixpkgs/pull/504192
2026-05-30 14:48:46 +00:00
Austin HorstmanandMatt Sturgeon 7f6f92a3c9 modules/lsp/onAttach: preserve event scope
Pass the LspAttach autocmd event into the shared onAttach helper so existing configs can still read event.buf and event.data.client_id after dynamic registration support moved the user body out of the autocmd callback.

For registerCapability reruns, provide a synthetic event with the fields Neovim documents for LspAttach that nixvim can still know: buf and data.client_id.

Fixes #4335
2026-05-21 21:32:05 +00:00
Austin Horstman c7e82d37c2 modules/lsp/onAttach: handle dynamic registrations
Some LSP servers register capabilities after LspAttach, so the global onAttach body must also run from client/registerCapability for buffers already attached to that client.

Keep the initial LspAttach autocmd for servers that advertise capabilities up front, and preserve the wrapped handler's return value.

Closes #3323
2026-05-20 17:06:06 +00:00
Gaetan Lepage 06cace835d modules/lsp: update packages 2026-05-16 04:38:30 +00:00
Gaetan Lepage cfd83c774b lsp/servers: mark csskit as unpackaged 2026-04-16 14:38:59 +00:00
Austin HorstmanandGaétan Lepage b0d5d9320d modules/lsp/servers: declare new generated server entries
Add package mappings for newly generated lspconfig servers that are packaged in nixpkgs, and mark the remaining generated entries as unpackaged so the generated-sources check stays in sync.
2026-04-09 22:47:18 +00:00
Gaetan LepageandMatt Sturgeon ed0424f0b0 lsp/servers/packages: add package for graphql 2026-02-15 06:09:31 +00:00
Gaetan Lepage d859217cf5 lsp/servers/packages: add oxfmt 2026-02-09 08:51:23 +00:00
Gaetan LepageandAustin Horstman aa893e2052 lsp/servers: update packages 2026-02-05 20:18:49 +00:00
Austin HorstmanandMatt Sturgeon abf20426cd modules/lsp/servers: add new unpackaged deps 2026-01-24 06:08:49 +00:00
Gaetan LepageandAustin Horstman db8177775e lsp/servers/packages: mark home_assistant as unpackaged 2025-12-28 04:26:49 +00:00
Gaetan LepageandAustin Horstman d2a0db38b7 lsp/servers/packages: add package for systemd_lsp 2025-12-28 04:26:49 +00:00
Gaetan LepageandMatt Sturgeon f0d62ddab4 lsp/servers/packages: mark brioche and hylo_ls as unpackaged 2025-12-17 21:23:05 +00:00
Matt Sturgeon 771cb3c852 plugins/lsp: inline explicit server option declarations 2025-12-16 14:09:46 +00:00
Matt Sturgeon 882eb84c35 plugins/lsp: drop customCmd
These have all been upstreamed into nvim-lspconfig. Going forward, we
should continue that trend.

If any nix-specific `cmd`s aren't accepted in nvim-lspconfig, they can
be patched in Nixpkgs instead.
2025-12-16 14:09:46 +00:00
Matt Sturgeon 12a76dd12b modules/lsp/servers: simplify displayName and packageName
Move the `let in` block defining `displayName` and `packageName` up so
it doesn't have to deal with the module arg `name` shadowing `args.name`.

This simplifies the implementation and reduces repetition.
2025-12-15 10:58:28 +00:00
Matt Sturgeon 753f7640d6 modules/lsp/servers: simplify activate default
The default for `lsp.servers.<name>.activate` used to be conditional on
whether `name == "*"`. This is leftover from before the * server was
moved to its own `global-server.nix` module and can now be removed.
2025-12-15 10:58:28 +00:00
Matt SturgeonandGaétan Lepage c97e8e3425 modules/lsp: move packages.nix from plugins.lsp
Move plugins/lsp/lsp-packages.nix -> modules/lsp/servers/packages.nix
2025-12-13 17:19:54 +00:00
Matt SturgeonandGaétan Lepage 463fb0ad5d modules/lsp: fix mkServerOption homepage tryEval evaluation
`lib.pipe` strictly evaluates intermediate steps using `foldl'`. As a
result, piping `(opts: opts.package.default or null)` →
`(package: (tryEval package).value)` is ineffective because
`opts.package.default` is evaluated before `tryEval` can catch exceptions.

Instead, inline `opts.package.default` directly into the `tryEval`
expression, ensuring missing package errors caught correctly.

Resolves errors when building NixOS or nix-darwin docs that include
Nixvim options.

Adds a regression test.
2025-12-08 15:37:52 +00:00
saygo-pngandMatt Sturgeon 03a51dbf3d treewide: NixVim/nixvim -> Nixvim
Signed-off-by: saygo-png <saygo.mail@proton.me>
2025-12-04 23:22:21 +00:00
Matt Sturgeon bb9d744b64 modules/lsp: propagate pkgs arg to server modules
This allows simplifying the `importApply` and also paves the way for
custom server modules to define arbitrary package options.
2025-10-10 14:11:54 +00:00
Matt Sturgeon 9e77c8e4a9 modules/lsp: allow servers to install multiple packages
Adds two internal per-server options: `packages.prefix` & `packages.suffix`.

These options allow the server module to install multiple packages, and
control which end up being prefixed or suffixed on the PATH.

This simplifies the propagating code in `modules/lsp/servers/default.nix`,
which can now zip up the enabled server `packages` attrs.
2025-10-10 14:11:54 +00:00
Matt Sturgeon 2414e8e99f modules/lsp: auto-import per-server custom modules
Adding a module in the following places will import the module into that
specific server's submodule.

This allows creating server-specific options.

Added a test case to ensure all custom modules correspond to an actual
server option to avoid accidental dead code.
2025-10-10 14:11:54 +00:00
Matt Sturgeon cf6c8ef1fa modules/lsp: be explicit about shorthandOnlyDefinesConfig
`shorthandOnlyDefinesConfig` is true by default for `lib.types.submodule`,
and false by default for `lib.types.submoduleWith` and `lib.evalModules`.

Since we rely on it for our `lsp.servers.*.config` option, let's enable
it explicitly.
2025-10-09 15:31:01 +00:00
Matt Sturgeon 9f336d2d71 modules/lsp: rename server settingsconfig
See RFC: https://github.com/nix-community/nixvim/issues/3745

This effectively reverts 21688b1d2a
2025-10-09 15:31:01 +00:00
Matt Sturgeon 20a7c92306 modules/lsp: handle missing package in server option desc
The `lsp.servers.<name>` option description links to the server's
homepage if it can evaluate the default package's `meta.homepage`.

However, users may evaluate this description, e.g. when building NixOS
docs with `documentation.nixos.includeAllModules`. Further, users may
have a different nixpkgs revisions to ours. Therefore, we need to allow
for the package not being in nixpkgs.

Since `mkPackageOption` will throw in the default, we can catch it with
`tryEval`.
2025-10-07 21:41:36 +00:00
Matt SturgeonandGaétan Lepage 94331cc50d plugins/lsp: use the new lsp module under the hood
- Re-implement setup wrapping and capabilities to preserve existing
  behaviour
- Alias `package` options to new lsp module
- Alias `packageFallback` options to new lsp module
- Alias `preConfig` and `postConfig` to `lsp.luaConfig`
2025-09-30 20:16:00 +00:00
Matt Sturgeon cb3653a1a8 modules/lsp: select relevant fields in keymaps table
We only use `mode`, `key`, `action`, and `options`; so explicitly
inherit those.

This means we don't serialise attrs that aren't needed at runtime,
such as `lspBufAction`.
2025-09-30 17:01:17 +00:00
Matt Sturgeon f421af99fe modules/lsp: print keymaps table multiline
Makes `init.lua` easier to read.

Follow up to 9faa339d9e
2025-09-30 17:01:17 +00:00
Gaetan Lepage 9faa339d9e modules/lsp: use a for loop to create LSP keymaps 2025-09-30 07:30:40 +00:00
Matt Sturgeon 167ea865e5 modules/lsp: port packageFallback option from plugins.lsp
Added to `plugins.lsp` in 6a054de04d
2025-09-28 23:07:35 +00:00
Andrey PetrovandGitHub 1c5c991fda modules/lsp/servers: Fix lua_ls example
Example was referring to `luals` instead of `lua_ls`
2025-05-25 11:29:19 -04:00
Matt Sturgeon cbd5f7de5e modules/lsp/onAttach: fix bufnr and document event arg
`:h event-args`: https://neovim.io/doc/user/api.html#event-args
`:h LspAttach`: https://neovim.io/doc/user/lsp.html#LspAttach

Fixes #3319
2025-05-13 18:45:00 +01:00
Matt Sturgeon a45b5f372f modules/lsp: add onAttach option
Similar to `plugins.lsp.onAttach`, implement a "global" equivalent to
the per-server `on_attach` callback.

This is implemented using a `LspAttach` autoCmd.
2025-05-06 14:08:03 +01:00
Matt Sturgeon 5308425718 modules/lsp/servers: move to dedicated file/dir
Move the code related to the `lsp.servers` option into a dedicated module,
cleaning up `modules/lsp/default.nix`.
2025-05-05 23:43:30 +01:00
Matt Sturgeon 552dec0e55 modules/lsp/keymaps: init
Initial LSP keymaps option, inspired by `keymapsOnEvent` and
`plugins.lsp.keymaps`.

Users can define `lspBufAction` instead of `action` if they wish to use
a `vim.lsp.buf.<action>` callback.
2025-05-03 22:50:28 +01:00
Matt Sturgeon 90eb4e681c modules/lsp/servers: move the * server to its own module
Introduce a bespoke `global-server.nix` module. This is less DRY, but
much simpler.

The `lsp.servers."*"` options are different enough from the other
`lsp.servers.<name>` options that it is simpler to just declare them
separately.

Now that we have a dedicated `global-server.nix` module, we no longer
need to split the normal server module into `server.nix`+`server-base.nix`

This partially reverts f2e96b67a3
2025-05-03 20:20:19 +01:00
Matt Sturgeon a072e3c3a7 modules/lsp: enable servers."*" by default 2025-05-01 00:36:41 +01:00
Matt Sturgeon b6e2016b7f modules/lsp: check if server settings is empty
Avoid unnecessary lua lines by checking if `server.settings` is empty
before writing `vim.lsp.config()` to `init.lua`.
2025-05-01 00:36:16 +01:00
Matt Sturgeon f2e96b67a3 modules/lsp: declare a stripped down servers."*" option
`"*"` is effectively a meta server, where shared config/defaults can be
set.

It shouldn't have options like `activate` or `package` which relate to
"real" servers. Therefore, we'll use `server-base.nix` directly, instead
of the full `server.nix` module.
2025-05-01 00:12:39 +01:00