mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-05-19 13:30:17 +00:00
treesitter: support usage of pkgs.tree-sitter-grammars
This commit is contained in:
parent
ee3f6a2ff6
commit
53e89665ce
4 changed files with 23 additions and 4 deletions
|
|
@ -291,6 +291,10 @@
|
|||
|
||||
[Snoweuph](https://github.com/snoweuph)
|
||||
|
||||
- Allow the usage of `pks.tree-sitter-grammars` in
|
||||
{option}`vim.treesitter.grammars` and language module tree-sitter package
|
||||
options created via `mkGrammarOption`.
|
||||
|
||||
- Add `emmet-ls` to the supported LSPs for all languages it supports.
|
||||
|
||||
- Added {option}`vim.treesitter.queries` to support adding custom queries.
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
in {
|
||||
inherit (typesDag) dagOf;
|
||||
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType;
|
||||
inherit (typesLanguage) diagnostics mkGrammarOption;
|
||||
inherit (typesLanguage) diagnostics mkGrammarOption mkTreesitterGrammarOption;
|
||||
inherit (typesLsp) mkLspPresetEnableOption;
|
||||
inherit (customTypes) char hexColor mergelessListOf deprecatedSingleOrListOf enumWithRename;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,17 @@
|
|||
default = ["vimPlugins" "nvim-treesitter" "grammarPlugins" grammar];
|
||||
nullable = true;
|
||||
};
|
||||
|
||||
# Prefer using `mkGrammarOption` and only use this, for grammars,
|
||||
# not in `vimPlugins.nvim-treesitter.grammarPlugins`.
|
||||
# Grammars from `tree-sitter-grammars.tree-sitter-<name>` should mostly
|
||||
# just work, but should be tested extra, as we currently only use them
|
||||
# for a small subset of language modules.
|
||||
mkTreesitterGrammarOption = pkgs: grammar:
|
||||
mkPackageOption pkgs ["${grammar} treesitter"] {
|
||||
default = ["tree-sitter-grammars" "tree-sitter-${grammar}"];
|
||||
nullable = true;
|
||||
};
|
||||
in {
|
||||
inherit diagnostics diagnosticSubmodule mkGrammarOption;
|
||||
inherit diagnostics diagnosticSubmodule mkGrammarOption mkTreesitterGrammarOption;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,8 +41,12 @@ in {
|
|||
'';
|
||||
description = ''
|
||||
List of treesitter grammars to install. For grammars to be installed properly,
|
||||
you must use grammars from `pkgs.vimPlugins.nvim-treesitter.parsers` or `pkgs.vimPlugins.nvim-treesitter.grammarPlugins`.
|
||||
You can use `pkgs.vimPlugins.nvim-treesitter.allGrammars` to install all grammars.
|
||||
you must use grammars from one of those:
|
||||
- `pkgs.vimPlugins.nvim-treesitter.parsers`
|
||||
- `pkgs.vimPlugins.nvim-treesitter.grammarPlugins`
|
||||
- `pkgs.tree-sitter-grammars` (mostly untested)
|
||||
|
||||
You can use `pkgs.vimPlugins.nvim-treesitter.allGrammars` to install all grammars shipped with `nvim-treesitter`.
|
||||
|
||||
For languages already supported by nvf, you may use
|
||||
{option}`vim.language.<lang>.treesitter` options, which will automatically add
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue