-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Languages (java,kotlin,terraform): add treesitter options
- Loading branch information
1 parent
60950c0
commit 582710f
Showing
4 changed files
with
95 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
pkgs, | ||
config, | ||
lib, | ||
... | ||
}: | ||
with lib; | ||
with builtins; let | ||
cfg = config.vim.languages.java; | ||
in { | ||
options.vim.languages.java = { | ||
enable = mkEnableOption "Java language support"; | ||
|
||
treesitter = { | ||
enable = mkOption { | ||
description = "Enable Java treesitter"; | ||
type = types.bool; | ||
default = config.vim.languages.enableTreesitter; | ||
}; | ||
package = nvim.options.mkGrammarOption pkgs "java"; | ||
}; | ||
}; | ||
config = mkIf cfg.enable (mkMerge [ | ||
(mkIf cfg.treesitter.enable { | ||
vim.treesitter.enable = true; | ||
vim.treesitter.grammars = [cfg.treesitter.package]; | ||
}) | ||
]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
pkgs, | ||
config, | ||
lib, | ||
... | ||
}: | ||
with lib; | ||
with builtins; let | ||
cfg = config.vim.languages.kotlin; | ||
in { | ||
options.vim.languages.kotlin = { | ||
enable = mkEnableOption "Kotlin language support"; | ||
|
||
treesitter = { | ||
enable = mkOption { | ||
description = "Enable kotlin treesitter"; | ||
type = types.bool; | ||
default = config.vim.languages.enableTreesitter; | ||
}; | ||
package = nvim.options.mkGrammarOption pkgs "kotlin"; | ||
}; | ||
}; | ||
config = mkIf cfg.enable (mkMerge [ | ||
(mkIf cfg.treesitter.enable { | ||
vim.treesitter.enable = true; | ||
vim.treesitter.grammars = [cfg.treesitter.package]; | ||
}) | ||
]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
pkgs, | ||
config, | ||
lib, | ||
... | ||
}: | ||
with lib; | ||
with builtins; let | ||
cfg = config.vim.languages.terraform; | ||
in { | ||
options.vim.languages.terraform = { | ||
enable = mkEnableOption "Terraform language support"; | ||
|
||
treesitter = { | ||
enable = mkOption { | ||
description = "Enable terraform treesitter"; | ||
type = types.bool; | ||
default = config.vim.languages.enableTreesitter; | ||
}; | ||
package = nvim.options.mkGrammarOption pkgs "terraform"; | ||
}; | ||
}; | ||
config = mkIf cfg.enable (mkMerge [ | ||
(mkIf cfg.treesitter.enable { | ||
vim.treesitter.enable = true; | ||
vim.treesitter.grammars = [cfg.treesitter.package]; | ||
}) | ||
]); | ||
} |