Gaetan Lepage
735fbeece8
Revert "helpers/vim-plugin: fix mkVimPlugin when defaultPackage.meta.homepage doesn't exist"
...
This reverts commit a6b247359f
.
2024-06-21 08:53:33 +02:00
Gaetan Lepage
846b3c991e
helpers/vim-plugin: fix mkVimPlugin when defaultPackage.meta.homepage doesn't exist
2024-06-18 11:38:52 +02:00
Matt Sturgeon
36b4a39b2b
lib/types: allow assigning raw lua to string lua
...
Relax the check a little to allow (slightly) incorrect usage and enable migrating option types to string lua types.
2024-06-17 00:01:40 +01:00
Matt Sturgeon
2d063c2c24
lib/types: simplify isRawType
...
No change in behaviour.
2024-06-17 00:01:39 +01:00
Matt Sturgeon
69e43a6bf9
plugins/none-ls: refactor mkRaw
...
- Allow passing raw types through mkRaw
- Throw an error when passing invalid input into mkRaw
2024-06-17 00:01:39 +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
f34fda8d99
meta: extend meta.nixvimInfo
support treewide
...
Rather than supplying a `kind` and `name` pair, we now supply a raw
path.
This path could point to any nixvim option.
2024-06-07 22:22:55 +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
302262304e
lib/keymaps: refactor mkMapOptionSubmodule
again
...
Allow passing in `key` and `action` as either bool or an attrset.
If `false`, the option is omitted. If `true` or an attrset, the option is included.
If an attrset is used, it will update the default `mkOption` args.
This is useful for overriding `type` or adding an `example`.
2024-06-07 15:42:54 +01:00
Matt Sturgeon
c16533b3f7
lib: add upperFirstChar
...
A util function to capitalize the first character of a string.
2024-06-07 09:17:29 +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
df3aa86713
lib/keymap-helpers: refactor mkMapOptionSubmodule
...
Make the `key` and `action` options optional, and allow configuring
whether `action` can be a raw type.
2024-06-01 16:19:35 +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
Matt Sturgeon
fc542329cd
lib/options: add mkNullOrOption'
variant
2024-06-01 14:33:40 +01:00
Matt Sturgeon
57003fea4e
lib/options: inline mkDefaultDesc
into mkDesc
...
And add function documentation.
2024-06-01 14:33:40 +01:00
Gaetan Lepage
d15fade62b
helpers/toLuaObject: fix rawKey handling
2024-05-31 23:31:11 +02:00
Gaetan Lepage
0ba2ea5416
helpers: add rawKeysAttrs
2024-05-31 21:53:40 +02:00
Gaetan Lepage
03c5f5eb74
helpers/toLuaObject: add support for raw keys
2024-05-31 21:53:40 +02:00
Matt Sturgeon
29922e13f7
modules/keymaps: fix false-positive lua
warning
2024-05-31 20:38:53 +01:00
Ismaïl Senhaji
6ff3493c9b
modules/keymaps: doc: add backticks around noremap
...
Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
2024-05-30 22:27:24 +02:00
Ismaïl Senhaji
6d3d3bd0c2
modules/keymaps: doc: add backticks around special arguments
2024-05-30 22:27:24 +02:00
Ismaïl Senhaji
bea8492e19
modules/keymaps: add "buffer" option to mapConfigOptions
2024-05-30 15:46:30 +02:00
Matt Sturgeon
51240cef0e
lib/options: defaultNullOpts
delegate string rendering
2024-05-30 14:27:37 +01:00
Matt Sturgeon
ff1ab1700c
lib/options: mkEnum
quote default if string
...
As there's only a handful of call-sites to fix, ensure all `mkEnum`
defaults are passed in as the correct type (tree wide) and change
`mkEnum` to now correctly render string-type defaults "quoted" (like
`mkString` does).
2024-05-30 14:27:37 +01:00
ben
ea69144d60
maintainers: add b3nb5n
2024-05-30 14:23:23 +02:00
Nate Smith
099f9f0f59
maintainers: add nwjsmith
2024-05-29 20:52:07 +01:00
Matt Sturgeon
b113bc69ea
lib/options: mkStr
quote default string
2024-05-29 09:50:03 +01:00
Matt Sturgeon
cedc1e4799
lib/options: use code-block for multiline defaults
...
Detect whether a plugin default is multiline using `hasInfix "\n"`.
Also remove `multiline=false` from the `toPretty` call.
2024-05-29 09:25:55 +01:00
Gaetan Lepage
ef63d3477f
colorschemes: set the colorscheme as mkDefault to allow for overriding
2024-05-28 21:30:43 +02:00
Matt Sturgeon
daa6b0f5cf
lib/options: defaultNullOpts support non-string defaults
2024-05-28 20:16:17 +01:00
Matt Sturgeon
8212bf1cd2
modules/keymaps: deprecate lua
option
2024-05-26 15:26:06 +01:00
Gaetan Lepage
7c4fe30f81
lib/options: introduce new mkPackageOption for dependencies
2024-05-17 22:15:47 +02:00
Gaetan Lepage
26367692da
lib/options: rename mkPackageOption to mkPluginPackageOption
2024-05-17 22:15:47 +02:00