mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-01-08 09:09:49 +01:00
languages/solidity: init solidity module
This commit is contained in:
parent
ac905b8aed
commit
637f749d4c
5 changed files with 33 additions and 1 deletions
|
@ -74,6 +74,7 @@ isMaximal: {
|
||||||
julia.enable = false;
|
julia.enable = false;
|
||||||
vala.enable = false;
|
vala.enable = false;
|
||||||
scala.enable = false;
|
scala.enable = false;
|
||||||
|
solidity.enable = false;
|
||||||
r.enable = false;
|
r.enable = false;
|
||||||
gleam.enable = false;
|
gleam.enable = false;
|
||||||
dart.enable = false;
|
dart.enable = false;
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
|
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
|
||||||
|
|
||||||
- Add Haskell support under `vim.languages.haskell` using [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):
|
[diniamo](https://github.com/diniamo):
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ in {
|
||||||
./r.nix
|
./r.nix
|
||||||
./rust.nix
|
./rust.nix
|
||||||
./scala.nix
|
./scala.nix
|
||||||
|
./solidity.nix
|
||||||
./sql.nix
|
./sql.nix
|
||||||
./svelte.nix
|
./svelte.nix
|
||||||
./tailwind.nix
|
./tailwind.nix
|
||||||
|
|
|
@ -71,7 +71,7 @@ in {
|
||||||
cmd = ${
|
cmd = ${
|
||||||
if isList cfg.lsp.package
|
if isList cfg.lsp.package
|
||||||
then expToLua 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)
|
on_attach = function(client, bufnr, ht)
|
||||||
default_on_attach(client, bufnr, ht)
|
default_on_attach(client, bufnr, ht)
|
||||||
|
|
29
modules/plugins/languages/solidity.nix
Normal file
29
modules/plugins/languages/solidity.nix
Normal 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];
|
||||||
|
};
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
Loading…
Reference in a new issue