File tree Expand file tree Collapse file tree 40 files changed +108
-98
lines changed
modules/plugins/languages Expand file tree Collapse file tree 40 files changed +108
-98
lines changed Original file line number Diff line number Diff line change 11{ lib } : let
2+ inherit ( builtins ) warn toJSON ;
23 inherit ( lib . options ) mergeEqualOption ;
34 inherit ( lib . lists ) singleton ;
45 inherit ( lib . strings ) isString stringLength match ;
2930 check = v : isString v && ( match "#?[0-9a-fA-F]{6}" v ) != null ;
3031 } ;
3132
32- singleOrListOf = t : coercedTo t singleton ( listOf t ) ;
33+ # no compound types please
34+ deprecatedSingleOrListOf = option : t :
35+ coercedTo
36+ t
37+ ( x :
38+ warn ''
39+ ${ option } no longer accepts non-list values, use [${ toJSON x } ] instead
40+ ''
41+ ( singleton x ) )
42+ ( listOf t ) ;
3343}
Original file line number Diff line number Diff line change 1010 inherit ( typesDag ) dagOf ;
1111 inherit ( typesPlugin ) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType ;
1212 inherit ( typesLanguage ) diagnostics mkGrammarOption ;
13- inherit ( customTypes ) char hexColor mergelessListOf singleOrListOf ;
13+ inherit ( customTypes ) char hexColor mergelessListOf deprecatedSingleOrListOf ;
1414}
Original file line number Diff line number Diff line change 88 inherit ( lib . options ) mkEnableOption mkOption ;
99 inherit ( lib . modules ) mkIf mkMerge ;
1010 inherit ( lib . types ) enum ;
11- inherit ( lib . nvim . types ) mkGrammarOption singleOrListOf ;
11+ inherit ( lib . nvim . types ) mkGrammarOption deprecatedSingleOrListOf ;
1212 inherit ( lib . meta ) getExe ;
1313 inherit ( lib . nvim . attrsets ) mapListToAttrs ;
1414
3434 lsp = {
3535 enable = mkEnableOption "Assembly LSP support" // { default = config . vim . lsp . enable ; } ;
3636 servers = mkOption {
37- type = singleOrListOf ( enum ( attrNames servers ) ) ;
37+ type = deprecatedSingleOrListOf "vim.language.asm.lsp.servers" ( enum ( attrNames servers ) ) ;
3838 default = defaultServers ;
3939 description = "Assembly LSP server to use" ;
4040 } ;
Original file line number Diff line number Diff line change 1111 inherit ( lib . meta ) getExe ;
1212 inherit ( lib . types ) enum coercedTo ;
1313 inherit ( lib . nvim . attrsets ) mapListToAttrs ;
14- inherit ( lib . nvim . types ) mkGrammarOption diagnostics singleOrListOf ;
14+ inherit ( lib . nvim . types ) mkGrammarOption diagnostics deprecatedSingleOrListOf ;
1515 inherit ( lib . generators ) mkLuaInline ;
1616
1717 cfg = config . vim . languages . astro ;
7777 } ;
7878
7979 formatType =
80- singleOrListOf
80+ deprecatedSingleOrListOf
8181 "vim.languages.astro.format.type"
8282 ( coercedTo ( enum [ "prettierd" ] ) ( _ :
8383 lib . warn
9797 lsp = {
9898 enable = mkEnableOption "Astro LSP support" // { default = config . vim . lsp . enable ; } ;
9999 servers = mkOption {
100- type = singleOrListOf "vim.languages .astro.lsp.servers" ( enum ( attrNames servers ) ) ;
100+ type = deprecatedSingleOrListOf "vim.language .astro.lsp.servers" ( enum ( attrNames servers ) ) ;
101101 default = defaultServers ;
102102 description = "Astro LSP server to use" ;
103103 } ;
Original file line number Diff line number Diff line change 1010 inherit ( lib . modules ) mkIf mkMerge ;
1111 inherit ( lib . types ) enum bool ;
1212 inherit ( lib . generators ) mkLuaInline ;
13- inherit ( lib . nvim . types ) diagnostics mkGrammarOption singleOrListOf ;
13+ inherit ( lib . nvim . types ) diagnostics mkGrammarOption deprecatedSingleOrListOf ;
1414 inherit ( lib . nvim . attrsets ) mapListToAttrs ;
1515
1616 cfg = config . vim . languages . bash ;
5555 lsp = {
5656 enable = mkEnableOption "Bash LSP support" // { default = config . vim . lsp . enable ; } ;
5757 servers = mkOption {
58- type = singleOrListOf ( enum ( attrNames servers ) ) ;
58+ type = deprecatedSingleOrListOf "vim.language.bash.lsp.servers" ( enum ( attrNames servers ) ) ;
5959 default = defaultServers ;
6060 description = "Bash LSP server to use" ;
6161 } ;
6868 description = "Enable Bash formatting" ;
6969 } ;
7070 type = mkOption {
71- type = singleOrListOf ( enum ( attrNames formats ) ) ;
71+ type = deprecatedSingleOrListOf "vim.language.bash.format.type" ( enum ( attrNames formats ) ) ;
7272 default = defaultFormat ;
7373 description = "Bash formatter to use" ;
7474 } ;
Original file line number Diff line number Diff line change 1010 inherit ( lib . meta ) getExe ;
1111 inherit ( lib . modules ) mkIf mkMerge ;
1212 inherit ( lib . generators ) mkLuaInline ;
13- inherit ( lib . nvim . types ) mkGrammarOption singleOrListOf ;
13+ inherit ( lib . nvim . types ) mkGrammarOption deprecatedSingleOrListOf ;
1414 inherit ( lib . nvim . attrsets ) mapListToAttrs ;
1515 inherit ( lib . nvim . dag ) entryAfter ;
1616
194194
195195 servers = mkOption {
196196 description = "The clang LSP server to use" ;
197- type = singleOrListOf ( enum ( attrNames servers ) ) ;
197+ type = deprecatedSingleOrListOf "vim.language.clang.lsp.servers" ( enum ( attrNames servers ) ) ;
198198 default = defaultServers ;
199199 } ;
200200 } ;
Original file line number Diff line number Diff line change 1212 inherit ( lib . meta ) getExe ;
1313 inherit ( lib . generators ) mkLuaInline ;
1414 inherit ( lib . strings ) optionalString ;
15- inherit ( lib . nvim . types ) mkGrammarOption singleOrListOf ;
15+ inherit ( lib . nvim . types ) mkGrammarOption deprecatedSingleOrListOf ;
1616 inherit ( lib . nvim . lua ) toLuaObject ;
1717 inherit ( lib . nvim . attrsets ) mapListToAttrs ;
1818
185185 enable = mkEnableOption "C# LSP support" // { default = config . vim . lsp . enable ; } ;
186186 servers = mkOption {
187187 description = "C# LSP server to use" ;
188- type = singleOrListOf ( enum ( attrNames servers ) ) ;
188+ type = deprecatedSingleOrListOf "vim.language.csharp.lsp.servers" ( enum ( attrNames servers ) ) ;
189189 default = defaultServers ;
190190 } ;
191191 } ;
Original file line number Diff line number Diff line change 99 inherit ( lib . meta ) getExe ;
1010 inherit ( lib . modules ) mkIf mkMerge ;
1111 inherit ( lib . types ) enum ;
12- inherit ( lib . nvim . types ) mkGrammarOption singleOrListOf ;
12+ inherit ( lib . nvim . types ) mkGrammarOption deprecatedSingleOrListOf ;
1313 inherit ( lib . nvim . attrsets ) mapListToAttrs ;
1414
1515 cfg = config . vim . languages . css ;
5858 enable = mkEnableOption "CSS LSP support" // { default = config . vim . lsp . enable ; } ;
5959
6060 servers = mkOption {
61- type = singleOrListOf ( enum ( attrNames servers ) ) ;
61+ type = deprecatedSingleOrListOf "vim.language.css.lsp.servers" ( enum ( attrNames servers ) ) ;
6262 default = defaultServer ;
6363 description = "CSS LSP server to use" ;
6464 } ;
6969
7070 type = mkOption {
7171 description = "CSS formatter to use" ;
72- type = singleOrListOf ( enum ( attrNames formats ) ) ;
72+ type = deprecatedSingleOrListOf "vim.language.css.format.type" ( enum ( attrNames formats ) ) ;
7373 default = defaultFormat ;
7474 } ;
7575 } ;
Original file line number Diff line number Diff line change 1111 inherit ( lib . options ) mkEnableOption mkOption ;
1212 inherit ( lib . types ) enum package nullOr str bool ;
1313 inherit ( lib . strings ) optionalString ;
14- inherit ( lib . nvim . types ) mkGrammarOption singleOrListOf ;
14+ inherit ( lib . nvim . types ) mkGrammarOption deprecatedSingleOrListOf ;
1515 inherit ( lib . nvim . dag ) entryAfter ;
1616 inherit ( lib . nvim . attrsets ) mapListToAttrs ;
1717
5252 lsp = {
5353 enable = mkEnableOption "Dart LSP support" // { default = config . vim . lsp . enable ; } ;
5454 servers = mkOption {
55- type = singleOrListOf ( enum ( attrNames servers ) ) ;
55+ type = deprecatedSingleOrListOf "vim.language.dart.lsp.servers" ( enum ( attrNames servers ) ) ;
5656 default = defaultServers ;
5757 description = "Dart LSP server to use" ;
5858 } ;
Original file line number Diff line number Diff line change 1010 inherit ( lib . meta ) getExe ;
1111 inherit ( lib . types ) enum ;
1212 inherit ( lib . generators ) mkLuaInline ;
13- inherit ( lib . nvim . types ) mkGrammarOption singleOrListOf ;
13+ inherit ( lib . nvim . types ) mkGrammarOption deprecatedSingleOrListOf ;
1414 inherit ( lib . nvim . dag ) entryAnywhere ;
1515 inherit ( lib . nvim . attrsets ) mapListToAttrs ;
1616
6060 lsp = {
6161 enable = mkEnableOption "Elixir LSP support" // { default = config . vim . lsp . enable ; } ;
6262 servers = mkOption {
63- type = singleOrListOf ( enum ( attrNames servers ) ) ;
63+ type = deprecatedSingleOrListOf "vim.language.elixir.lsp.servers" ( enum ( attrNames servers ) ) ;
6464 default = defaultServers ;
6565 description = "Elixir LSP server to use" ;
6666 } ;
7070 enable = mkEnableOption "Elixir formatting" // { default = config . vim . languages . enableFormat ; } ;
7171
7272 type = mkOption {
73- type = singleOrListOf ( enum ( attrNames formats ) ) ;
73+ type = deprecatedSingleOrListOf "vim.language.elixir.format.type" ( enum ( attrNames formats ) ) ;
7474 default = defaultFormat ;
7575 description = "Elixir formatter to use" ;
7676 } ;
You can’t perform that action at this time.
0 commit comments