mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-31 11:02:37 +00:00 
			
		
		
		
	language/rust: migrate to conform/nvim-lint
This commit is contained in:
		
					parent
					
						
							
								2c153f57e6
							
						
					
				
			
			
				commit
				
					
						24a3989ddc
					
				
			
		
					 1 changed files with 8 additions and 10 deletions
				
			
		|  | @ -5,6 +5,7 @@ | ||||||
|   ... |   ... | ||||||
| }: let | }: let | ||||||
|   inherit (builtins) attrNames; |   inherit (builtins) attrNames; | ||||||
|  |   inherit (lib.meta) getExe; | ||||||
|   inherit (lib.modules) mkIf mkMerge; |   inherit (lib.modules) mkIf mkMerge; | ||||||
|   inherit (lib.options) mkOption mkEnableOption; |   inherit (lib.options) mkOption mkEnableOption; | ||||||
|   inherit (lib.strings) optionalString; |   inherit (lib.strings) optionalString; | ||||||
|  | @ -21,14 +22,6 @@ | ||||||
|   formats = { |   formats = { | ||||||
|     rustfmt = { |     rustfmt = { | ||||||
|       package = pkgs.rustfmt; |       package = pkgs.rustfmt; | ||||||
|       nullConfig = '' |  | ||||||
|         table.insert( |  | ||||||
|           ls_sources, |  | ||||||
|           null_ls.builtins.formatting.rustfmt.with({ |  | ||||||
|             command = "${cfg.format.package}/bin/rustfmt", |  | ||||||
|           }) |  | ||||||
|         ) |  | ||||||
|       ''; |  | ||||||
|     }; |     }; | ||||||
|   }; |   }; | ||||||
| in { | in { | ||||||
|  | @ -128,8 +121,13 @@ in { | ||||||
|     }) |     }) | ||||||
| 
 | 
 | ||||||
|     (mkIf cfg.format.enable { |     (mkIf cfg.format.enable { | ||||||
|       vim.lsp.null-ls.enable = true; |       vim.formatter.conform-nvim = { | ||||||
|       vim.lsp.null-ls.sources.rust-format = formats.${cfg.format.type}.nullConfig; |         enable = true; | ||||||
|  |         setupOpts.formatters_by_ft.rust = [cfg.format.type]; | ||||||
|  |         setupOpts.formatters.${cfg.format.type} = { | ||||||
|  |           command = getExe cfg.format.package; | ||||||
|  |         }; | ||||||
|  |       }; | ||||||
|     }) |     }) | ||||||
| 
 | 
 | ||||||
|     (mkIf (cfg.lsp.enable || cfg.dap.enable) { |     (mkIf (cfg.lsp.enable || cfg.dap.enable) { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ching Pei Yang
				Ching Pei Yang