diff options
| author | kiyan <yazdani.kiyan@protonmail.com> | 2022-02-06 13:34:08 +0100 |
|---|---|---|
| committer | Kiyan <yazdani.kiyan@protonmail.com> | 2022-02-06 14:30:57 +0100 |
| commit | 58a4897e6d5f21a9178ae0f802d47af26d67a219 (patch) | |
| tree | 74336582ebfd82021824d9710096065d0d6a3727 /README.md | |
| parent | d7eab3a5a9ddcbd6d2719ca065601c8a0f4f11c8 (diff) | |
refacto: deprecate used_by in parsers.lua
- remove print_warning function from utils.lua (unused)
- cleanup some functions in parsers.lua (parameters overloading
and wrong bufnr used).
- log a deprecation notice when using used_by in a parser definition
- default the filetype_to_parsername table to the list of filetypes
previously in the used_by keys
- update the README to indicate that change
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -355,12 +355,19 @@ parser_config.zimbu = { generate_requires_npm = false, -- if stand-alone parser without npm dependencies requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c }, - filetype = "zu", -- if filetype does not agrees with parser name - used_by = {"bar", "baz"} -- additional filetypes that use this parser + filetype = "zu", -- if filetype does not match the parser name } EOF ``` +If you wish to set a specific parser for a filetype, you should extend the `filetype_to_parsername` table: +```vim +lua <<EOF +local ft_to_parser = require"nvim-treesitter.parser".filetype_to_parsername +filetype_to_parsername.someft = "python" -- the someft filetype will use the python parser and queries. +EOF +``` + 4. Start `nvim` and `:TSInstall zimbu`. You can also skip step 2 and use `:TSInstallFromGrammar zimbu` to install directly from a `grammar.js` in the top-level directory specified by `url`. |
