Matt Sturgeon
1d8724144c
lib/options: add TODO regarding lua-types
...
`defaultNullOpts` is generally used for representing lua-options.
We should probably a) rename it something like `luaOptions` and switch
out the primitive types to use the new `lua-types`.
2025-06-04 09:07:48 +00:00
Firelight Flagboy
56e8230939
lib/options: Add mkEnabledOption
...
Like `lib.options.mkEnableOption` but it's enabled by default
2025-02-06 01:56:55 +00:00
Quentin Boyer
a2f01876f7
lib: Harmonize package options which may not exist in nixpkgs
2025-01-31 22:55:38 +00:00
Gaetan Lepage
91227dca9e
lib/options: add defaultNullOpts.mkFloat
2025-01-04 00:15:16 +01:00
Gaetan Lepage
2e600f5796
lib/options: add defaultNullOpts.mkProportion
2025-01-03 23:31:37 +01:00
Gaetan Lepage
caef39133f
lib/options: mkAttrsOf, mkListOf, mkAttributeSet should accept raw values
2024-12-31 11:00:20 +01:00
Gaetan Lepage
c04dda021b
lib/options/mkRaw: automatically convert example strings to rawLua type
2024-12-31 00:10:49 +01:00
Gaetan Lepage
7500425d31
lib/options/mkRaw': handle pluginDefault=null
2024-12-27 23:36:04 +00:00
Heitor Augusto
f878289722
lib/plugins: make plugin optional when lazy-loading
2024-12-26 23:00:27 +00:00
Austin Horstman
63c81b1778
lib/options: mkLazyLoadOption: packPathName -> name
2024-12-13 21:30:36 -06:00
Austin Horstman
a7012e7864
treewide: originalName -> packPathName
...
We used to only think of it as the plugin repo's name, but we have been
needing to use it for the name of the plugin's packpath location.
2024-12-13 21:29:00 -06:00
Austin Horstman
0997b371c7
lib/neovim-plugin: freeform lazy settings
...
Instead of trying to manage upstream configuration options, just keep
using our freeform options so we can do less finicky logic and
workarounds.
2024-12-10 10:07:38 -06:00
Austin Horstman
c3f9cb721c
lib/neovim-plugin: refactor mkLazyLoadOption
2024-12-10 10:07:38 -06:00
Austin Horstman
3cfde1554c
lib/neovim-plugin: support lz-n lazy config
2024-12-10 08:28:16 -06:00
Austin Horstman
da30527de1
lib/neovim-plugin: use mkLazyLoadOption
2024-12-10 08:28:16 -06:00
psfloyd
6ed719dba8
lib/options: added mkLazyLoadOption
2024-12-10 08:28:16 -06:00
Matt Sturgeon
be455f7f27
lib/options: use literalLua
for defaultNullOpts.mkRaw
2024-11-15 21:46:25 +00:00
Gaetan Lepage
ccae4350d0
options: add defaultNullOpts.mkRaw
2024-11-13 23:38:31 +01:00
Matt Sturgeon
bd6aa476b8
lib/options: remove redundant mkRaw
apply
functions
...
`strLua` now does this coercion internally.
2024-09-29 16:57:15 +01:00
Matt Sturgeon
cd76b4feb8
lib: remove helpers
from internal usage
2024-09-29 14:41:41 +01:00
Matt Sturgeon
555035ef79
lib: add types.flagInt
+ defaultNullOpts.mkIntFlag
...
Either `0` or `1`, but can be coerced from a boolean definition to
support legacy definitions.
When coerced, a warning is printed
2024-09-08 12:54:30 +01:00
Matt Sturgeon
fd923a3dd3
lib/options: remove deprecated package option helpers
...
`mkPackageOption` and `mkPluginPackageOption` have both been replaced
with nixpkg's `lib.mkPackageOption`.
2024-09-05 02:24:52 +01:00
Austin Horstman
35788bbc5a
lib: cleanup with lib
2024-09-03 22:12:33 -05:00
Matt Sturgeon
285f6cbd7b
lib/*-plugin: use lib.mkPackageOption
internally
...
Instead of maintainers providing an actual `defaultPackage`, they should
specify the pkg name which we'll use when calling `lib.mkPackageOption`.
This makes `mkVimPlugin` and `mkNeovimPlugin` compliant with #1950 .
2024-09-04 03:07:49 +01:00
Matt Sturgeon
b7f419a759
lib: migrate helpers.nixvimTypes
-> lib.types
2024-08-21 07:37:11 +01:00
Matt Sturgeon
bc84fda2b8
lib/options: remove with helpers
2024-08-01 17:55:03 +01:00
Matt Sturgeon
0e98d9cf1e
lib/helpers: build recursively
2024-07-28 22:30:11 +01:00
Matt Sturgeon
0e8b248a52
lib/options: allow rawLua
in mkEnum'
default
2024-07-08 17:48:00 +01:00
Matt Sturgeon
9000e69f4b
lib/options: drop special case for string defaults
...
No longer assume that string-type plugin defaults are already
pre-formatted.
Instead, pre-formatted values should be defined using
`literalExpression` or `literalMD`.
2024-06-21 08:45:30 +01:00
Matt Sturgeon
582641a639
lib/options: fix minor typo
2024-06-14 12:29:53 +01:00
Matt Sturgeon
8e8c22ce65
lib/options: rename convertArgs
to processDefaultNullArgs
2024-06-14 12:28:59 +01:00
Matt Sturgeon
5cec79e59f
lib/options: migrate defaultNullOpts
to use pluginDefault
...
Rename all instances where the plugin default argument is named
`default` to `pluginDefault` to avoid conflict.
2024-06-14 12:25:06 +01:00
Matt Sturgeon
e51b8b9b5c
lib/options: remove defaultNullOpts.mkDesc
...
Leave a stub for now, which aborts with an error message.
2024-06-14 10:56:11 +01:00
Matt Sturgeon
a8943f2502
lib/options: allow pluginDefault
in any helper
...
All helpers eventually go through `mkNullOrOption`, so we can move where
`pluginDefault` is handled there.
Added a private helper `processNixvimArgs` that can be used by any future
helper that needs to call `lib.mkOption` directly.
It might make sense to offer a `helpers.mkOption` which simply wraps
`lib.mkOption` but with support for custom args like `pluginDefault`?
2024-06-14 10:49:05 +01:00
Matt Sturgeon
33a32c9417
lib/options: move "plugin default" into defaultText
...
Introduce a new `helpers.pluginDefaultText` and deprecate `helpers.defaultNullOpts.mkDesc`.
Displaying the "plugin default" within `defaultText` ensures that both
defaults are grouped together in the docs.
Also take the first step towards transitioning `defaultNullOpts` from
using `default` to `pluginDefault` to mean "plugin default".
2024-06-10 15:11:21 +01:00
Matt Sturgeon
b2a477260d
docs: emphasise "Plugin default" to match nixpkgs
...
Nixpkg's "headings" are emphasised in italics ("Default", "Example",
"Type", etc). We should match the style.
2024-06-07 17:47:33 +01:00
Matt Sturgeon
ade4539b3f
lib/options: defaultNullOpts
don't require having a default
...
Made the `default` and `description` arguments optional for all prime
variants of `defaultNullOpts` functions.
If neither `default` nor `description` are provided, the option will
have no description.
The "Plugin default" line is only added when a `default` argument is
present (`args ? default`).
2024-06-07 17:34:46 +01:00
Matt Sturgeon
f7e009d29e
lib/options: add mkEnum'
argument assertions
2024-06-02 03:18:11 +01:00
Matt Sturgeon
a2443ac0d6
lib/options: add more defaultNullOpts
'variants
...
All `defaultNullOpts` functions now have a prime variant.
2024-06-02 03:18:10 +01:00
Matt Sturgeon
87d6654a9f
lib/options: remove mkStr
assert
...
If a non-string is passed in, it'll be formatted here. This is okay
because `mkDesc` will not re-format anyway.
2024-06-01 15:08:14 +01:00
Matt Sturgeon
297aa6d0a2
lib/options: make mkPackageOption
use mkNullOrOption'
2024-06-01 14:33:43 +01:00
Matt Sturgeon
1bb4cb9c6c
lib/options: add mkAttrsOf'
& mkListOf'
(etc)
2024-06-01 14:33:43 +01:00
Matt Sturgeon
e0b60bac8b
lib/options: add mkNullableWithRaw'
variant
2024-06-01 14:33:42 +01:00
Matt Sturgeon
84b2b0d90c
lib/options: add mkNullable'
variant
2024-06-01 14:33:42 +01:00
Matt Sturgeon
ed56221499
lib/options: add mkNullOrStrLuaFnOr'
variant
2024-06-01 14:33:42 +01:00
Matt Sturgeon
5bcb6184b0
lib/options: add mkNullOrStrLuaOr'
variant
2024-06-01 14:33:41 +01:00
Matt Sturgeon
56ee982cb4
lib/options: add mkNullOrLuaFn'
variant
2024-06-01 14:33:41 +01:00
Matt Sturgeon
207bfc6e69
lib/options: add mkNullOrLua'
variant
2024-06-01 14:33:41 +01:00
Matt Sturgeon
3a151bbf09
lib/options: add mkNullOrStr'
variant
2024-06-01 14:33:41 +01:00
Matt Sturgeon
9bf7724b98
lib/options: add mkCompositeOption'
variant
2024-06-01 14:33:40 +01:00