Commit graph

81 commits

Author SHA1 Message Date
Matt Sturgeon
a072e3c3a7
modules/lsp: enable servers."*" by default 2025-05-01 00:36:41 +01:00
Johan Larsson
eeae362038
modules/lsp: add enable = true to wildcard config section 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
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
6415ae4a97 tests/modules/performance/combine-plugins: improve assertion messages
This commit eliminates assertions boilerplate and improves assertion
message by returning the number of plugins and their names.
2025-04-28 17:26:13 +03: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
57e19ec3ec tests/modules/performance/combine-plugins: use stub plugins for tests
During the last half of the year many dependencies of plugins used in
the tests were changed in nixpkgs. To make tests more robust use a
specially crafted stub plugins.
2025-04-28 17:26:13 +03:00
Stanislav Asunkin
9c39ea4ccb tests/modules/performance/byte-compile-lua: fix tests
telescope-nvim doesn't have explicit dependency on plenary-nvim anymore.
Use noice-nvim which have a dependency on nui-nvim instead.
2025-04-28 17:26:13 +03:00
Stanislav Asunkin
014b143f6a tests/modules/performance/combine-plugins: restore test functionality
Replace test plugins to those that reflect the intention for the test.
2025-04-28 17:26:13 +03:00
Stanislav Asunkin
faa31d994c Revert "tests/modules-performance: add nvim-cmp to extraPlugins when necessary"
This reverts commit bb5b0a2655.

This change defeats the purpose of the dependency test. Revert it.
The test should verify that dependencies are correctly pulled. If
upstream plugin doesn't have dependency anymore, then a suitable
alternative should be used, not dependencies added manually.
2025-04-28 17:26:13 +03:00
Gaetan Lepage
89c94d9ea7 plugins/telescope/media-files: use the top-level dependencies option 2025-04-27 11:28:18 +02: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
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
Gaetan Lepage
991f3c8709 treewide: re-enable godot tests 2025-04-24 12:48:41 +02:00
Gaetan Lepage
9eb03ab777 treewide: disable godot (build failure) 2025-04-22 12:16:02 +00:00
Gaetan Lepage
7a58109958 tests/dependencies: extend the disabled logic to the "examples" test case 2025-04-21 16:08:11 +02:00
Gaetan Lepage
91073486b2 tests/dependencies: add disabled list to skip testing broken dependencies 2025-04-21 13:55:36 +02:00
Matt Sturgeon
d94956e5da
lib/deprecation: implement aliases for mkRemovedPackageOptionModule
Allows most existing configs to continue building, now with warnings
instead of assertions when the old `plugins.*.*Package` options are
used.

An assertion will still occur if there is a merge conflict, e.g:
`plugins.a.fooPackage = null` and `plugins.b.fooPackage = pkgs.foo`.
2025-04-15 22:15:18 +01: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
72ce6dbdf5 tests/modules/dependencies: test all package examples 2025-04-12 00:37:55 +10:00
Gaetan Lepage
cfd4b61262 modules/dependencies: init + add curl 2025-04-11 08:51:45 +10:00
Gaetan Lepage
77c5fe808a modules/lua-loader: use new 0.11 API for enabling/disabling 2025-04-01 16:03:03 +02:00
Gaetan Lepage
95573411bc modules/keymaps: add replace_keycodes keymap sub-option 2025-03-28 11:32:49 +01:00
Matt Sturgeon
00586f8f1b
modules/output: move symlinkJoin to build.package 2025-01-20 14:49:59 +00:00
Matt Sturgeon
5b068e7f8f
tests/nixpkgs: move nixpkgs module test to dedicated drv
This should be separate from `test-sources` because we want to re-use a
common instance of nixpkgs throughout those tests.

Also, moved the existing nixpkgs module test from `test-sources`.

This partially reverts commit c4ad4d0b2e.
2025-01-15 18:04:06 +00:00
Gaetan Lepage
bb5b0a2655 tests/modules-performance: add nvim-cmp to extraPlugins when necessary 2024-11-30 18:13:15 +01:00
Heitor Augusto
1d78aee791 tests/modules/clipboard: add raw lua code test 2024-11-15 18:40:10 +00:00
Heitor Augusto
f11a877bcc
tests/modules/output: add tests for providers 2024-11-13 16:55:33 -03:00
Matt Sturgeon
c4ad4d0b2e
modules/nixpkgs: add overlays option
Based on the `nixpkgs.overlays` option available in NixOS, allows users
to further customize the `pkgs` instance used when evaluating nixvim.

The standard module tests are now provided a few extra module args to
enable a test where we instantiate a custom nixpkgs instance.
2024-10-19 21:11:42 +01:00
Stanislav Asunkin
767eb62f48 modules/output: obtain plugin configs from wrapped neovim
The official method for obtaining the generated initRc content is from
wrapped neovim rather than from makeNeovimConfig helper. To use this
approach: first wrap neovim with the generated config, then override it
with our wrapperArgs.
2024-10-13 09:54:05 +03:00
Stanislav Asunkin
21f7ed6eb6 tests/modules/output: test that init.lua contains all config sections
This test was removed in 3d1224a039 to
remove IFD. Rewrite the test using `pkgs.runCommandLocal` and grep.
2024-10-13 09:28:12 +03:00
Austin Horstman
75ae10571d
tests/byte-compile-lua: server_configurations -> configs
bedb2a0df1
2024-10-10 08:58:59 -05:00
Matt Sturgeon
6a1bf6bdc3
modules/output: check warnings+assertions on build.package
Add a `build.packageUnchecked` option for use instead of the old `check`
evalNixvim argument.
2024-09-26 18:04:36 +01:00
Matt Sturgeon
692e39311e
modules/{output,files,test}: move outputs to build scope
Move the following output options into `build`:
- finalPackage -> package
- printInitPackage
- initPath -> initFile
- filesPlugin -> extraFiles
- test.derivation -> test
2024-09-26 06:31:57 +01:00
Matt Sturgeon
4e5bd1d79b
lib: segregate and deprecate functions that need pkgs
Splits everything that depends on a `pkgs` instance into an optional
attrs, allowing `helpers.nix` to be bootstrapped without `pkgs`.

This required some refactoring:
- `modules.specialArgs` is only available when `pkgs` is used
- `modules.specialArgsWith` now requires `defaultPkgs` be provided
- `builders.*` now have `*With` variants that take `pkgs` as an argument
  and a `withPkgs` function that returns the old interface
- Had to define the fixed part of `builders` outside the attrs for now,
  to avoid infinite recursion.
- The old `builders` are now deprecated, and print a warning when
  evaluated
- `withOptoinalFns` was introduced to merge the optional attrs into the
  final lib.
2024-09-13 19:05:26 +01:00
Matt Sturgeon
123a55ed6f
tests: remove special treatment of module
Since we no longer need to extract `tests.dontRun` from an attrset, we
no longer need the "special" `module` attr.
2024-08-20 01:07:21 +01:00
Austin Horstman
00f32f0430
tests/lua-loader: builtins.match -> lib.hasInfix
Getting invalid regex expression on darwin.
2024-08-16 08:55:38 -05:00
Matt Sturgeon
3d1224a039
tests/modules/output: remove IFD 2024-08-04 00:13:12 +01:00
Stanislav Asunkin
9314cd46f0 modules/performance: add ability to byte compile nvim runtime directory
This commit adds `performance.byteCompileLua.nvimRuntime` toggle that,
if enabled, byte compiles all lua files in Nvim runtime directory.
2024-07-31 11:31:40 +00:00
Stanislav Asunkin
55ca9d235b modules/performance: add ability to byte compile lua plugins
This commit adds `performance.byteCompileLua.plugins` toggle that, if
enabled, byte compiles all lua files in plugins
2024-07-31 11:31:40 +00:00
Stanislav Asunkin
44849233e0 modules/performance: add ability to byte compile lua configuration files
This commit adds support for byte compiling lua configuration files.
It's enabled by default (if byte compiling is enabled at all) and can be
disabled with `performance.byteCompileLua.configs` toggle.

To implement this feature `extraFiles.<name>.finalSource` internal
read-only option is introduced. `source` option cannot be used because
it's user configurable. In order to access the values of the
`performance.byteCompileLua` options, parent config is added to
specialArgs of extraFiles submodule. Then the usages of `source` option
changed to `finalSource` in all relevant places (filesPlugin and
wrappers).

Added more helpers for various cases of byte compiling:

* `byteCompileLuaFile` byte compiles lua file
* `byteCompileLuaHook` is a setup hook that byte compiles all lua files
* `byteCompileLuaDrv` overrides derivation by adding byteCompileLuaHook
  to it

Added tests to validate that extraFiles specified by various methods are
handled correctly. Added a separate home-manager test, that is intended
to validate that extraFiles propagated to wrapper modules are correctly
byte compiled.
2024-07-31 11:31:40 +00:00
Stanislav Asunkin
17e8904992 modules/performance: add performance.byteCompileLua option
* add `performance.byteCompileLua.enable` toggle to enable or disable
  all byte compiling features
* add `performance.byteCompileLua.initLua` toggle to enable or
  disable byte compiling of init.lua
* add `writeByteCompiledLua` helper for saving byte compiled lua source
  code to the nix store
* `nixvim-print-init` utility is always pointed to uncompiled init.lua
* add tests
2024-07-31 11:31:40 +00:00
Stanislav Asunkin
6e2ec5ed02 modules/performance: add plenary filetypes directory to default pathsToLink
plenary.nvim is often pulled as a dependency of other plugins.
It has filetype definitions in `data/plenary/filetypes` directory.
Even though I don't think there are plugins using it instead of
vim.filetype, but it should be no harm to add this directory by default.
2024-07-24 16:50:50 +02:00
Stanislav Asunkin
0c32f5bda5 modules/performance: don't combine filesPlugin into plugin pack
It's expected that user may want to override some runtime files in its
own config directory. Do not combine it into plugin pack to avoid
collisions.
2024-07-24 16:50:50 +02:00
Stanislav Asunkin
e65c9590d0 modules/performance: add combinePlugins.standalonePlugins option 2024-07-24 16:50:50 +02:00
Stanislav Asunkin
d6bebcefa3 modules/performance: handle plugin configs when combining plugins 2024-07-24 16:50:50 +02:00
Stanislav Asunkin
27201addd7 modules/performance: handle optional plugins when combining plugins 2024-07-24 16:50:50 +02:00
Stanislav Asunkin
f900dcd6aa modules/performance: handle python3 dependencies when combining plugins 2024-07-24 16:50:50 +02:00
Stanislav Asunkin
fdb3950c59 modules/performance: add an option to combine plugins to a single plugin pack 2024-07-24 16:50:50 +02:00