From 58a4897e6d5f21a9178ae0f802d47af26d67a219 Mon Sep 17 00:00:00 2001 From: kiyan Date: Sun, 6 Feb 2022 13:34:08 +0100 Subject: [PATCH] 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 --- README.md | 11 +++++-- lua/nvim-treesitter/parsers.lua | 57 ++++++++++++++++----------------- lua/nvim-treesitter/utils.lua | 6 ---- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 0601bfb59..a2c593b8e 100644 --- a/README.md +++ b/README.md @@ -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 <