File tree 2 files changed +49
-33
lines changed
tests/test-sources/plugins/pluginmanagers 2 files changed +49
-33
lines changed Original file line number Diff line number Diff line change 47
47
with types ;
48
48
let
49
49
pluginType = either package ( submodule {
50
+ freeformType = types . attrsOf types . anything ;
50
51
options = {
51
52
dir = helpers . mkNullOrOption str "A directory pointing to a local plugin" ;
52
53
162
163
plugin :
163
164
let
164
165
keyExists = keyToCheck : attrSet : lib . elem keyToCheck ( lib . attrNames attrSet ) ;
166
+ converted =
167
+ if isDerivation plugin then
168
+ { dir = "${ lazyPath } /${ lib . getName plugin } " ; }
169
+ else
170
+ let
171
+ handledPluginOptions = {
172
+ "__unkeyed" = plugin . name ;
173
+
174
+ inherit ( plugin )
175
+ cmd
176
+ cond
177
+ config
178
+ dev
179
+ enabled
180
+ event
181
+ ft
182
+ init
183
+ keys
184
+ lazy
185
+ main
186
+ module
187
+ name
188
+ optional
189
+ opts
190
+ priority
191
+ submodules
192
+ ;
193
+
194
+ dependencies = helpers . ifNonNull' plugin . dependencies (
195
+ if isList plugin . dependencies then ( pluginListToLua plugin . dependencies ) else plugin . dependencies
196
+ ) ;
197
+
198
+ dir =
199
+ if plugin ? dir && plugin . dir != null then plugin . dir else "${ lazyPath } /${ lib . getName plugin . pkg } " ;
200
+ } ;
201
+ freeformPluginOptions = lib . removeAttrs plugin ( ( lib . attrNames handledPluginOptions ) ++ [ "pkg" ] ) ;
202
+ combinedPluginOptions = freeformPluginOptions // handledPluginOptions ;
203
+ in
204
+ combinedPluginOptions ;
165
205
in
166
- if isDerivation plugin then
167
- { dir = "${ lazyPath } /${ lib . getName plugin } " ; }
168
- else
169
- {
170
- "__unkeyed" = plugin . name ;
171
-
172
- inherit ( plugin )
173
- cmd
174
- cond
175
- config
176
- dev
177
- enabled
178
- event
179
- ft
180
- init
181
- keys
182
- lazy
183
- main
184
- module
185
- name
186
- optional
187
- opts
188
- priority
189
- submodules
190
- ;
191
-
192
- dependencies = helpers . ifNonNull' plugin . dependencies (
193
- if isList plugin . dependencies then ( pluginListToLua plugin . dependencies ) else plugin . dependencies
194
- ) ;
195
-
196
- dir =
197
- if plugin ? dir && plugin . dir != null then plugin . dir else "${ lazyPath } /${ lib . getName plugin . pkg } " ;
198
- } ;
206
+ converted ;
199
207
200
208
pluginListToLua = map pluginToLua ;
201
209
Original file line number Diff line number Diff line change 28
28
plugins = [
29
29
vim-closer
30
30
31
+ # Test freeform
32
+ {
33
+ pkg = vim-dispatch ;
34
+ # The below is not actually a property in the `lazy.nvim` plugin spec
35
+ # but is purely to test freeform capabilities of the `pluginType`.
36
+ blah = "test" ;
37
+ }
38
+
31
39
# Load on specific commands
32
40
{
33
41
pkg = vim-dispatch ;
You can’t perform that action at this time.
0 commit comments