This commit is contained in:
Artur Manuel 2024-12-22 02:15:19 +00:00 committed by GitHub
commit bc4d8c97d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 33 additions and 1 deletions

View file

@ -74,6 +74,7 @@ isMaximal: {
julia.enable = false;
vala.enable = false;
scala.enable = false;
solidity.enable = false;
r.enable = false;
gleam.enable = false;
dart.enable = false;

View file

@ -14,6 +14,7 @@
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
- Add Haskell support under `vim.languages.haskell` using [haskell-tools.nvim].
- Add Solidity support under `vim.languages.solidity`.
[diniamo](https://github.com/diniamo):

View file

@ -27,6 +27,7 @@ in {
./r.nix
./rust.nix
./scala.nix
./solidity.nix
./sql.nix
./svelte.nix
./tailwind.nix

View file

@ -71,7 +71,7 @@ in {
cmd = ${
if isList cfg.lsp.package
then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/haskell-language-server-wrapper"}''
else ''{"${cfg.lsp.package}/bin/haskell-language-server-wrapper", "--lsp"}''
},
on_attach = function(client, bufnr, ht)
default_on_attach(client, bufnr, ht)

View file

@ -0,0 +1,29 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.vim.languages.solidity;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.options) mkEnableOption;
inherit (lib.nvim) mkGrammarOption;
in {
options.vim.languages.solidity = {
enable = mkEnableOption "Solidity support";
treesitter = {
enable = mkEnableOption "Treesitter support for Solidity";
package = mkGrammarOption pkgs "solidity";
};
};
config = mkIf cfg.enable (mkMerge [
(lib.mkIf cfg.treesitter.enable {
vim.treesitter = {
enable = true;
grammars = [cfg.treesitter.package];
};
})
]);
}