Tree-sitter parser for conventional comments.
Note
It wasn't named tree-sitter-comment as that name is already taken and this parser isn't strictly for comments.
- Supports a subset of
markdownsuch as,- Italic text
- Bold text
Inline_codeCode blocks
- Supports extra syntax such as,
'Single quoted text'"Double quoted text"@mentionsowner/repo#12(Issue reference)https://example.com(links)
- Supports correct tree structure for topics, subjects, description etc. to be leveraged by plugins/external programs.
- Queries(syntax & injection) for common comment topics(e.g. NOTE, WIP, FIX etc.).
Important
Make sure to run :TSUninstall comment to remove the old parser as this is meant to be a replacement.
Note
We only support the main branch of nvim-treesitter!
Put this in your nvim-treesitter config,
vim.api.nvim_create_autocmd("User", {
pattern = "TSUpdate",
callback = function()
require("nvim-treesitter.parsers").comment = {
install_info = {
url = "https://github.com/OXY2DEV/tree-sitter-comment",
branch = "main", -- only needed if different from default branch
queries = "queries/",
},
}
end
})Now, quit & open Neovim and run this command,
:TSInstall comment-
Install the
tree-sitterCLI tool. -
Clone the repository in your machine and
cdinto it. -
Run
tree-sitter build(if it tells you to install dependencies then you should install them and retry). -
Copy the
comment.sofile to~/.config/nvim/parser/.
Copy everything inside queries/ to ~/.config/nvim/queries/comment/ in your machine.
