Make dictionary apply to harper
This commit is contained in:
		
							parent
							
								
									73f84b50da
								
							
						
					
					
						commit
						95b91e5ac4
					
				
					 2 changed files with 15 additions and 1 deletions
				
			
		|  | @ -18,6 +18,7 @@ | ||||||
|         # https://github.com/helix-editor/helix/blob/master/languages.toml |         # https://github.com/helix-editor/helix/blob/master/languages.toml | ||||||
|         # https://helix-editor.vercel.app/reference/formatters |         # https://helix-editor.vercel.app/reference/formatters | ||||||
|         # https://docs.helix-editor.com/lang-support.html |         # https://docs.helix-editor.com/lang-support.html | ||||||
|  |         # https://docs.helix-editor.com/languages.html | ||||||
|         languages = lib.mkOption { |         languages = lib.mkOption { | ||||||
|           description = '' |           description = '' | ||||||
|             Configuration for Helix `languages.toml`. |             Configuration for Helix `languages.toml`. | ||||||
|  |  | ||||||
|  | @ -98,6 +98,16 @@ | ||||||
|             }; |             }; | ||||||
|             file = tomlFormatter.generate "typos.toml" typos.content; |             file = tomlFormatter.generate "typos.toml" typos.content; | ||||||
|           }; |           }; | ||||||
|  |           harper = { | ||||||
|  |             dictionary = { | ||||||
|  |               name = "dictionary.txt"; | ||||||
|  |               text = builtins.concatStringsSep "\n" config.languages.en-us.dictionary; | ||||||
|  |               path = pkgs.writeTextFile { | ||||||
|  |                 name = harper.dictionary.name; | ||||||
|  |                 text = harper.dictionary.text; | ||||||
|  |               }; | ||||||
|  |             }; | ||||||
|  |           }; | ||||||
|         in |         in | ||||||
|         { |         { | ||||||
|           languages.en-us.dictionary = [ |           languages.en-us.dictionary = [ | ||||||
|  | @ -126,7 +136,10 @@ | ||||||
|               config.configPath = "${vale.directory.path}/${vale.config.name}"; |               config.configPath = "${vale.directory.path}/${vale.config.name}"; | ||||||
|             }; |             }; | ||||||
|             # https://writewithharper.com/docs/integrations/language-server#Supported-Languages |             # https://writewithharper.com/docs/integrations/language-server#Supported-Languages | ||||||
|             harper-ls.command = "${pkgs.harper}/bin/harper-ls"; |             harper-ls = { | ||||||
|  |               command = "${pkgs.harper}/bin/harper-ls"; | ||||||
|  |               config.harper-ls.userDictPath = harper.dictionary.path; | ||||||
|  |             }; | ||||||
|             typos = { |             typos = { | ||||||
|               command = "${pkgs.typos-lsp}/bin/typos-lsp"; |               command = "${pkgs.typos-lsp}/bin/typos-lsp"; | ||||||
|               config.config = typos.file.outPath; |               config.config = typos.file.outPath; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue