mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-30 18:47:52 +00:00 
			
		
		
		
	language/nim: migrate to conform/nvim-lint
This commit is contained in:
		
					parent
					
						
							
								ab5dbb263e
							
						
					
				
			
			
				commit
				
					
						e0bcd93bea
					
				
			
		
					 1 changed files with 9 additions and 10 deletions
				
			
		|  | @ -6,6 +6,7 @@ | ||||||
| }: let | }: let | ||||||
|   inherit (builtins) attrNames; |   inherit (builtins) attrNames; | ||||||
|   inherit (lib.options) mkEnableOption mkOption; |   inherit (lib.options) mkEnableOption mkOption; | ||||||
|  |   inherit (lib.meta) getExe; | ||||||
|   inherit (lib.modules) mkIf mkMerge; |   inherit (lib.modules) mkIf mkMerge; | ||||||
|   inherit (lib.lists) isList; |   inherit (lib.lists) isList; | ||||||
|   inherit (lib.types) enum either listOf package str; |   inherit (lib.types) enum either listOf package str; | ||||||
|  | @ -38,14 +39,9 @@ | ||||||
|   formats = { |   formats = { | ||||||
|     nimpretty = { |     nimpretty = { | ||||||
|       package = pkgs.nim; |       package = pkgs.nim; | ||||||
|       nullConfig = '' |       config = { | ||||||
|         table.insert( |         command = "${cfg.format.package}/bin/nimpretty"; | ||||||
|           ls_sources, |       }; | ||||||
|           null_ls.builtins.formatting.nimpretty.with({ |  | ||||||
|             command = "${pkgs.nim}/bin/nimpretty", |  | ||||||
|           }) |  | ||||||
|         ) |  | ||||||
|       ''; |  | ||||||
|     }; |     }; | ||||||
|   }; |   }; | ||||||
| in { | in { | ||||||
|  | @ -110,8 +106,11 @@ in { | ||||||
|     }) |     }) | ||||||
| 
 | 
 | ||||||
|     (mkIf cfg.format.enable { |     (mkIf cfg.format.enable { | ||||||
|       vim.lsp.null-ls.enable = true; |       vim.formatter.conform-nvim = { | ||||||
|       vim.lsp.null-ls.sources.nim-format = formats.${cfg.format.type}.nullConfig; |         enable = true; | ||||||
|  |         setupOpts.formatters_by_ft.nim = [cfg.format.type]; | ||||||
|  |         setupOpts.formatters.${cfg.format.type} = formats.${cfg.format.type}.config; | ||||||
|  |       }; | ||||||
|     }) |     }) | ||||||
|   ]); |   ]); | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ching Pei Yang
				Ching Pei Yang