lukas-reineke / headlines.nvim

This plugin adds horizontal highlights for text filetypes, like markdown, orgmode, and neorg.
MIT License
681 stars 27 forks source link

`vim.treesitter.parse_query()` error. maybe README is just the problem? #69

Open GitMurf opened 6 months ago

GitMurf commented 6 months ago

Not sure if there was a regression at some point that let this creep in, or if the docs have just always been outdated, but when you copy the default config options from the readme from here: https://github.com/lukas-reineke/headlines.nvim?tab=readme-ov-file#setup

It tells you to use vim.treesitter.parse_query() which throws an error. This was actually changed a year ago to be fixed but maybe the docs never got updated? see this PR: https://github.com/lukas-reineke/headlines.nvim/pull/51

In addition, the treesitter api has changed again so now even using from that PR vim.treesitter.query.parse_query() is deprecated, but it just gives you a warning and still lets you use it for now.

The latest and greatest API to use is using vim.treesitter.query.parse().

TLDR: need to use vim.treesitter.query.parse() going forward and need to update the readme to reflect that.

GaetanLepage commented 4 months ago

I think, this only concerns the README/doc. Fixed in #76