From 65c7033cbe75825c4cc948b71aba9a6d7a14540d Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Tue, 24 Sep 2024 08:41:46 -0700 Subject: feat(comment): allow commentstring to be determined from node metadata **Problem:** Some weird languages have different comment syntax depending on the location in the code, and we do not have a way to determine the correct `commentstring` for these special cases. **Solution:** Allow queries to specify `commentstring` values in metadata, allowing users/`nvim-treesitter` to provide a better commenting experience without hugely increasing the scope of the code in core. --- runtime/lua/vim/treesitter/query.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/lua/vim/treesitter') diff --git a/runtime/lua/vim/treesitter/query.lua b/runtime/lua/vim/treesitter/query.lua index 1b72151aac..17088ac0eb 100644 --- a/runtime/lua/vim/treesitter/query.lua +++ b/runtime/lua/vim/treesitter/query.lua @@ -608,6 +608,7 @@ predicate_handlers['any-vim-match?'] = predicate_handlers['any-match?'] ---@class vim.treesitter.query.TSMetadata ---@field range? Range ---@field conceal? string +---@field bo.commentstring? string ---@field [integer]? vim.treesitter.query.TSMetadata ---@field [string]? integer|string -- cgit