mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-31 19:12:38 +00:00 
			
		
		
		
	lspkind: integration with blink.cmp
This commit is contained in:
		
					parent
					
						
							
								9e2ddbba49
							
						
					
				
			
			
				commit
				
					
						122f3b3f35
					
				
			
		
					 1 changed files with 18 additions and 6 deletions
				
			
		|  | @ -8,16 +8,18 @@ | ||||||
|   inherit (lib.nvim.lua) toLuaObject; |   inherit (lib.nvim.lua) toLuaObject; | ||||||
| 
 | 
 | ||||||
|   cfg = config.vim.lsp.lspkind; |   cfg = config.vim.lsp.lspkind; | ||||||
|  |   usingCmp = config.vim.autocomplete.nvim-cmp.enable; | ||||||
|  |   usingBlink = config.vim.autocomplete.blink-cmp.enable; | ||||||
| in { | in { | ||||||
|   config = mkIf cfg.enable { |   config = mkIf cfg.enable { | ||||||
|     assertions = [ |     assertions = [ | ||||||
|       { |       { | ||||||
|         assertion = config.vim.autocomplete.nvim-cmp.enable; |         assertion = usingCmp || usingBlink; | ||||||
|         message = '' |         message = '' | ||||||
|           While lspkind supports Neovim's native lsp upstream, using that over |           While lspkind supports Neovim's native lsp upstream, using that over | ||||||
|           nvim-cmp isn't recommended, nor supported by nvf. |           nvim-cmp/blink.cmp isn't recommended, nor supported by nvf. | ||||||
| 
 | 
 | ||||||
|           Please migrate to nvim-cmp if you want to use lspkind. |           Please migrate to nvim-cmp/blink.cmp if you want to use lspkind. | ||||||
|         ''; |         ''; | ||||||
|       } |       } | ||||||
|     ]; |     ]; | ||||||
|  | @ -26,9 +28,19 @@ in { | ||||||
|       startPlugins = ["lspkind"]; |       startPlugins = ["lspkind"]; | ||||||
| 
 | 
 | ||||||
|       lsp.lspkind.setupOpts.before = config.vim.autocomplete.nvim-cmp.format; |       lsp.lspkind.setupOpts.before = config.vim.autocomplete.nvim-cmp.format; | ||||||
|       autocomplete.nvim-cmp.setupOpts.formatting.format = mkForce (mkLuaInline '' |       autocomplete = { | ||||||
|         require("lspkind").cmp_format(${toLuaObject cfg.setupOpts}) |         nvim-cmp = mkIf usingCmp { | ||||||
|       ''); |           setupOpts.formatting.format = mkForce (mkLuaInline '' | ||||||
|  |             require("lspkind").cmp_format(${toLuaObject cfg.setupOpts}) | ||||||
|  |           ''); | ||||||
|  |         }; | ||||||
|  | 
 | ||||||
|  |         blink-cmp = mkIf usingBlink { | ||||||
|  |           setupOpts.appearance.kind_icons = mkLuaInline '' | ||||||
|  |             require("lspkind").symbol_map | ||||||
|  |           ''; | ||||||
|  |         }; | ||||||
|  |       }; | ||||||
|     }; |     }; | ||||||
|   }; |   }; | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ching Pei Yang
				Ching Pei Yang