Commit graph

266 commits

Author SHA1 Message Date
sportshead
2b6f694b48 output: add extraPackagesAfter option
Some checks are pending
Build and deploy documentation / deploy (push) Waiting to run
Publish every Git push to main to FlakeHub / flakehub-publish (push) Waiting to run
Publish every git push to Flakestry / publish-flake (push) Waiting to run
Allow users to add packages to the end of `PATH` in the neovim wrapper.
This is useful for LSP versions that might need to be overriden based on
the environment, e.g. `haskell-language-server` versions provided by a
project's devshell.
2025-06-08 22:14:58 +00:00
Stanislav Asunkin
65d35db5ca modules/performance: fix specifying combinePlugin.standalonePlugins as packages when byte compilation enabled
Previously, specifying plugins as packages in the
`performance.combinePlugins.standalonePlugins` option did not work when
the `performance.byteCompileLua` option was also enabled. This issue was
due to several package transformations performed by the
`byteCompileLua` which broke package comparison.

There are at least three methods to fix the issue:

- Change transformation order: combine plugins first, then byte-compile
  them.
- Compare every possible transformation when determining if plugins are
  standalone.
- Get the name of the package and use it for comparison.

The first method did not work because the current `byteCompileLuaDrv`
implementation does not support symlinks to directories. The second
method appears too fragile. This commit implements the third method, as
it requires minimal code changes and is straightforward. The downside is
that it might exclude multiple packages with the same name, although
this should be rare.
2025-06-02 18:15:32 +03:00
Andrey Petrov
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
Stanislav Asunkin
49a7bb573a modules/top-level: change usages of import to callPackage 2025-05-12 17:39:01 +03:00
Stanislav Asunkin
75f2c1b1f1 modules/performance: ensure dependencies of lua packages also compiled
Previously only extraLuaPackages themselves were byte-compiled, not
theirs dependencies. This commit fixes that by compiling lua packages
recursively. It uses byte-compile-lua-lib.nix shared file.
Also this commit uses the shared stub lua libraries for extraLuaPackages
byte-compiling test.
2025-05-12 17:39:01 +03:00
Stanislav Asunkin
9474ce916a modules/performance: ensure all lua dependencies are byte-compiled
This commit replaces custom lua plugins in tests with shared stub
plugins from utils module.
After this change the test has started to fail. Debugging this issue
I found out that dependencies of plugins weren't processed.
This commit improves the test assertion to detect duplicated
dependencies in this case and fixes the underlying issue by also
processing dependencies.
2025-05-12 17:39:01 +03:00
Stanislav Asunkin
0d78a47792 modules/top-level/plugins: use mapNormalizedPlugins utils function 2025-05-12 17:39:01 +03:00
Stanislav Asunkin
2c6182351f modules/performance: add ability to byte-compile plugin lua dependencies
This commit adds byte compiling of plugin lua dependencies
(specifically propagatedBuildInputs). It's enabled by
`performance.byteCompileLua.luaLib` option.
2025-05-12 17:39:01 +03:00
Stanislav Asunkin
404e56066f modules/performance: add ability to byte compile extraLuaPackages
This commit adds `performance.byteCompileLua.luaLib` options. When
enabled it byte-compiles lua packages from extraLuaPackages option.
2025-05-12 17:39:01 +03:00
Austin Horstman
52c68b4da4 plugins/claude-code: add claude-code dependency 2025-05-08 10:35:31 +02: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
Johan Larsson
eeae362038
modules/lsp: add enable = true to wildcard config section 2025-04-30 20:55:26 +01:00
Johan Larsson
2d65c66a1a
modules/lsp: don't enable wildcard server
The wildcard server ("*") should have its config set, but not be enabled
through `vim.lsp.enable()`.
2025-04-30 20:55:26 +01:00
Matt Sturgeon
1df98b6636
modules/diagnostic: rename diagnostic.config -> diagnostic.settings
Follow up to #3226, in line with the decisions made in #3254.
2025-04-30 18:31:17 +01:00
Matt Sturgeon
21688b1d2a
modules/lsp/server: rename config -> settings
`config` is a loaded term within modules and options.

`settings` is the name usually used for freeform config in nixvim and
most other module configurations.
2025-04-30 17:35:46 +01:00
Matt Sturgeon
e34eaf8395
modules/lsp/server: declare package defaults
Convert the `attrsOf (servers.nix)` option to a freeform submodule.

Declare a `servers.nix` option for each lsp server listed in
`lsp-packages.nix` that has a known nixpkgs package.
2025-04-30 16:53:55 +01:00
Matt Sturgeon
29aa22c41a
modules/lsp: use relative link to plugins.lspconfig 2025-04-28 18:54:05 +01:00
Matt Sturgeon
5c67a96a86
modules/lsp: get nvim-lspconfig link from plugins.lspconfig.package 2025-04-28 18:54:04 +01:00
Matt Sturgeon
812b2b0903
modules/lsp: update wording for plugins.lspconfig recommendation 2025-04-28 18:54:04 +01:00
Matt Sturgeon
556eb29548
plugins/lspconfig: init
A simplified replacement for `plugins.lsp`.

Eventually, once the `lsp` and `plugins.lspconfig` modules are mature,
`plugins.lsp` will be deprecated and/or aliased.
2025-04-28 18:54:04 +01:00
Matt Sturgeon
29aa60b43a
modules/lsp: add per-server name option
This allows users to override the name used for a given `lsp.servers.*`
entry. The default is still the attr-name.

This may be useful to inject raw lua, or to configure the same server in
different ways via different attrs.
2025-04-28 18:23:49 +01:00
Matt Sturgeon
3722f88c5d
modules/lsp: move server module to dedicated file 2025-04-28 18:04:11 +01:00
Matt Sturgeon
74368bcfc1
modules/lsp: move to dedicated directory 2025-04-28 17:59:05 +01:00
Gaetan Lepage
70c9b3b890 modules/lsp: init
Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
2025-04-28 18:11:39 +02:00
Stanislav Asunkin
f28d384ab5 modules/performance/combine-plugins: propagate lua dependencies
Plugins from luarocks (e.g. telescope-nvim) have dependencies specified
in propagatedBuildInputs. These dependencies are not added as plugins in
Nvim runtime. They are added to LUA_PATH env var for wrapped neovim.
This commit collects all propagatedBuildInputs from input plugin list
and puts them in the combined plugin.
Note that such dependencies are never combined, because they are not
plugins.
2025-04-28 17:26:13 +03:00
Stanislav Asunkin
7bb135b091 Revert "modules/performance: temporary add plenary to extraPlugins to fix tests"
This reverts commit 5a491f4b2b.
2025-04-28 17:26:13 +03:00
Matt Sturgeon
6c73350557
modules/diagnostic: rename diagnostics -> diagnostic.config
Currently we represent `vim.diagnostic.config()` as a top-level
`diagnostics` option. This means we have no clear namespace for
(e.g.) `vim.diagnostic.<action>` keymap functions.
2025-04-26 20:09:23 +01:00
Matt Sturgeon
47f44488ae
modules/performance: document pathsToLink default
We set the default with "normal" priority, so explicitly list it as
`defaultText`.
2025-04-26 19:55:38 +01:00
Matt Sturgeon
6418cf3414
modules/performance: update runtimepath pathsToLink 2025-04-26 19:55:38 +01:00
Wyatt Avilla
d86fe3df56
modules/diagnostics: fix virtual_lines example
The setting is named `current_line`, not `only_current_line`.

See https://neovim.io/doc/user/diagnostic.html#vim.diagnostic.Opts.VirtualLines
2025-04-24 16:50:32 -07:00
Matt Sturgeon
55ad604d44
modules/dependencies: restore literal expression example support 2025-04-21 09:06:28 +01:00
Matt Sturgeon
fb80e0d0b5
modules/dependencies: coerce __depPackages attr-paths to list 2025-04-21 09:05:52 +01:00
Matt Sturgeon
1164b39963
modules/dependencies: add __depPackages example 2025-04-21 09:04:39 +01:00
Matt Sturgeon
af2f4266e2
modules/dependencies: add description to __depPackages 2025-04-21 08:40:40 +01:00
Gaetan Lepage
6c4e2d9279 modules/dependencies: introduce top-level (internal) __depPackages option 2025-04-20 22:57:52 +02:00
Gaetan Lepage
15919567bb modules/dependencies: add codeium, coreutils, gzip and util-linux 2025-04-14 01:23:52 +02:00
Matt Sturgeon
16879e3034
modules/dependencies: refactor all-examples test
Embed the original `path` as an attr in the literal expression, so that
we don't need to convert back from human readable paths in the test.
2025-04-13 18:23:06 +01:00
Gaetan Lepage
9bc29e6a9b modules/dependencies: add rust-analyzer 2025-04-11 08:51:45 +10:00
Gaetan Lepage
e7c9cc7133 modules/dependencies: add godot 2025-04-11 08:51:45 +10:00
Gaetan Lepage
06acf3f103 modules/dependencies: add flutter 2025-04-11 08:51:45 +10:00
Gaetan Lepage
55ec7c4187 modules/dependencies: add xxd 2025-04-11 08:51:45 +10:00
Gaetan Lepage
0a78c93e7a modules/dependencies: add llm-ls 2025-04-11 08:51:45 +10:00
Gaetan Lepage
75d2125e01 modules/dependencies: add tmux 2025-04-11 08:51:45 +10:00