When setting any filetype suboption to null (or anything else guarded by
mkIf) it's value becomes:
{ extension = null; filename = null; pattern = null; }
Account for that case in mkIf condition so that the option would not
produce empty filetype definition.
This avoids having the option always "defined".
This also avoids luaLoader configuration in extra files by default.
Earlier `vim.loader.disable()` was always added to configs produced
by `files` option, effectively disabling luaLoader even if it was
explicitly enabled in a top-level configuration.
Introduce `_mk-source-plugin.nix`, which returns a module handling a
specific none-ls source plugin.
This wasn't possible previously due to IFD conflicting with evaluating
module imports.
Adjusted the test to use the `options` provided via module args, and
cleaned up some stuff allowing "unpackaged" sources to not be listed
again in the test file.
The plugin's default is not compatible with nix, because it ends up in
the read-only /nix/store.
Set our default to the one used in their upcoming "1.0" version.
Added support for the plugin's "advanced" config settings.
Removed the enum restriction and prefix concatenation, allowing anything
to be passed through, including raw lua: fixes#1675
The theme list is now much shorter and is included directly in the option
description.
Some general cleanup, in particular to `extraConfig` and `customColorschemeType`.
Moved `extraFiles` from `modules/output.nix` into its own file `modules/files.nix`.
Users should now assign text to a `text` attribute, however they could
also assign a file path to a `source` attribute instead.
The old method of directly assigning a string still works, and is
coerced to the new type along with a deprecation warning.
`def.module or lib.removeAttrs def [ "tests" ]` is actually equivalent to
`(def.module or lib.removeAttrs) def [ "tests" ]`.
This meant whenever `def` had a `module` attribute, it was invoked as
`def.module def [ "tests" ]`!
Use `mkTestDerivationFromNixvimModule` instead of `mkTestDerivation`,
allowing "proper" modules to be used instead of plain attr configs.
This is useful for more complex tests that wish to use `config` or
`options` arguments, e.g:
```nix
{config, options, ...}: {
/* some cool test */
}
```
To allow `tests.dontRun` to be defined on such a test, the module is
allowed to be nested as `module`, e.g:
```nix
{
tests.dontRun = true;
module = {config, options, ...}: {
/* a disabled test */
};
}
```
Also ended up doing some general cleanup, removing an unused function,
etc.