File tree Expand file tree Collapse file tree 12 files changed +137
-23
lines changed
tests/test-sources/plugins/cmp Expand file tree Collapse file tree 12 files changed +137
-23
lines changed Original file line number Diff line number Diff line change 44} :
55let
66 inherit ( lib . nixvim ) defaultNullOpts ;
7+ name = "cmp-ai" ;
78in
89lib . nixvim . plugins . mkNeovimPlugin {
9- name = "cmp-ai" ;
10+ inherit name ;
1011
1112 maintainers = [ lib . maintainers . GaetanLepage ] ;
1213
1314 imports = [
14- { cmpSourcePlugins . cmp_ai = "cmp-ai" ; }
15+ ( lib . nixvim . modules . mkCmpPluginModule {
16+ pluginName = name ;
17+ sourceName = "cmp_ai" ;
18+ } )
1519 ] ;
1620
1721 moduleName = "cmp_ai.config" ;
Original file line number Diff line number Diff line change 22 lib ,
33 ...
44} :
5- lib . nixvim . plugins . mkNeovimPlugin {
5+ let
66 name = "cmp-git" ;
7+ in
8+ lib . nixvim . plugins . mkNeovimPlugin {
9+ inherit name ;
710 moduleName = "cmp_git" ;
811
912 imports = [
10- { cmpSourcePlugins . git = "cmp-git" ; }
13+ ( lib . nixvim . modules . mkCmpPluginModule {
14+ pluginName = name ;
15+ sourceName = "git" ;
16+ } )
1117 ] ;
1218
1319 maintainers = [ lib . maintainers . GaetanLepage ] ;
Original file line number Diff line number Diff line change 22let
33 inherit ( lib ) types ;
44 inherit ( lib . nixvim ) defaultNullOpts ;
5+ name = "cmp-tabby" ;
56in
67lib . nixvim . plugins . mkNeovimPlugin {
7- name = "cmp-tabby" ;
8+ inherit name ;
89
910 maintainers = [ lib . maintainers . GaetanLepage ] ;
1011
1112 imports = [
12- { cmpSourcePlugins . cmp_tabby = "cmp-tabby" ; }
13+ ( lib . nixvim . modules . mkCmpPluginModule {
14+ pluginName = name ;
15+ sourceName = "cmp_tabby" ;
16+ } )
1317 ] ;
1418
1519 deprecateExtraOptions = true ;
Original file line number Diff line number Diff line change 22let
33 inherit ( lib ) types ;
44 inherit ( lib . nixvim ) defaultNullOpts ;
5+ name = "cmp-tabnine" ;
56in
67lib . nixvim . plugins . mkNeovimPlugin {
7- name = "cmp-tabnine" ;
8+ inherit name ;
89
910 maintainers = [ lib . maintainers . GaetanLepage ] ;
1011
1112 imports = [
12- { cmpSourcePlugins . cmp_tabnine = "cmp-tabnine" ; }
13+ ( lib . nixvim . modules . mkCmpPluginModule {
14+ pluginName = name ;
15+ sourceName = "cmp_tabnine" ;
16+ } )
1317 ] ;
1418
1519 deprecateExtraOptions = true ;
Original file line number Diff line number Diff line change 44} :
55let
66 inherit ( lib . nixvim ) defaultNullOpts ;
7+ name = "codeium-nvim" ;
78in
89lib . nixvim . plugins . mkNeovimPlugin {
9- name = "codeium-nvim" ;
10+ inherit name ;
1011 packPathName = "codeium.nvim" ;
1112 moduleName = "codeium" ;
1213
@@ -51,9 +52,12 @@ lib.nixvim.plugins.mkNeovimPlugin {
5152 "wrapper"
5253 ] ;
5354
54- # Register nvim-cmp association
5555 imports = [
56- { cmpSourcePlugins . codeium = "codeium-nvim" ; }
56+ # Register nvim-cmp association
57+ ( lib . nixvim . modules . mkCmpPluginModule {
58+ pluginName = name ;
59+ sourceName = "codeium" ;
60+ } )
5761 ] ;
5862
5963 settingsOptions = {
Original file line number Diff line number Diff line change 22let
33 inherit ( lib ) types ;
44 inherit ( lib . nixvim ) defaultNullOpts ;
5+ name = "copilot-cmp" ;
56in
67lib . nixvim . plugins . mkNeovimPlugin {
7- name = "copilot-cmp" ;
8+ inherit name ;
89 moduleName = "copilot_cmp" ;
910
1011 imports = [
11- { cmpSourcePlugins . copilot = "copilot-cmp" ; }
12+ ( lib . nixvim . modules . mkCmpPluginModule {
13+ pluginName = name ;
14+ sourceName = "copilot" ;
15+ } )
1216 ] ;
1317
1418 maintainers = [ lib . maintainers . GaetanLepage ] ;
Original file line number Diff line number Diff line change 11{ lib , ... } :
2- lib . nixvim . plugins . mkNeovimPlugin {
2+ let
33 name = "crates" ;
4+ in
5+ lib . nixvim . plugins . mkNeovimPlugin {
6+ inherit name ;
47 packPathName = "crates.nvim" ;
58 package = "crates-nvim" ;
69
710 maintainers = [ lib . maintainers . GaetanLepage ] ;
811
912 imports =
10- [ { cmpSourcePlugins . crates = "crates" ; } ]
13+ [
14+ ( lib . nixvim . modules . mkCmpPluginModule {
15+ pluginName = name ;
16+ sourceName = name ;
17+ } )
18+ ]
1119 ++
1220 # TODO introduced 2024-12-12: remove after 25.05
1321 lib . nixvim . mkSettingsRenamedOptionModules [ "plugins" "crates-nvim" ]
Original file line number Diff line number Diff line change 11{ lib , pkgs , ... } :
2- lib . nixvim . plugins . mkNeovimPlugin {
2+ let
33 name = "papis" ;
4+ in
5+ lib . nixvim . plugins . mkNeovimPlugin {
6+ inherit name ;
47 packPathName = "papis.nvim" ;
58 package = "papis-nvim" ;
69
710 maintainers = [ lib . maintainers . GaetanLepage ] ;
811
9- # papis.nvim is an nvim-cmp source too
10- imports = [ { cmpSourcePlugins . papis = "papis" ; } ] ;
12+ imports = [
13+ # papis.nvim is an nvim-cmp source too
14+ ( lib . nixvim . modules . mkCmpPluginModule {
15+ pluginName = name ;
16+ sourceName = name ;
17+ } )
18+ ] ;
1119
1220 extraOptions = {
1321 yqPackage = lib . mkPackageOption pkgs "yq" {
Original file line number Diff line number Diff line change 11{ lib , ... } :
2- lib . nixvim . plugins . mkVimPlugin {
2+ let
33 name = "vim-dadbod-completion" ;
4+ in
5+ lib . nixvim . plugins . mkVimPlugin {
6+ inherit name ;
47 maintainers = [ lib . maintainers . BoneyPatel ] ;
58 imports = [
6- { cmpSourcePlugins . vim-dadbod-completion = "vim-dadbod-completion" ; }
9+ ( lib . nixvim . modules . mkCmpPluginModule {
10+ pluginName = name ;
11+ sourceName = name ;
12+ } )
713 ] ;
814}
Original file line number Diff line number Diff line change 1+ # TODO: Remove this legacy function in favor of using `mkCmpPluginModule` directly
12{
23 lib ,
34 pkgs ,
1213 ] { } ,
1314 maintainers ? [ lib . maintainers . GaetanLepage ] ,
1415 imports ? [ ] ,
16+ # Whether to add a `plugin.*.blink` option, that uses blink.compat
17+ mkCmpPluginModuleArgs ? { } ,
1518 ...
1619} @args :
1720lib . nixvim . plugins . mkVimPlugin (
@@ -24,8 +27,8 @@ lib.nixvim.plugins.mkVimPlugin (
2427 name = pluginName ;
2528
2629 imports = imports ++ [
27- # Register the source -> plugin name association
28- { cmpSourcePlugins . ${ sourceName } = pluginName ; }
30+ # Create the ` plugin.*.cmp` option
31+ ( lib . nixvim . modules . mkCmpPluginModule ( mkCmpPluginModuleArgs // { inherit pluginName sourceName ; } ) )
2932 ] ;
3033 }
3134)
You can’t perform that action at this time.
0 commit comments