seblj / nvim-lsp-extras

Some extra functionality I use to make neovim lsp a bit better
MIT License
7 stars 1 forks source link

fix: change deprecated treesitter query method get_query to get #1

Closed ybbond closed 1 year ago

ybbond commented 1 year ago

fix warning of (will be) deprecated treesitter query method

Screenshot 2023-03-27 at 23 28 54
seblj commented 1 year ago

Thanks! Could you add a conditional to check if the function exists so that we don't break things for potential users that havent updated their nightly yet?

I think something like this should work:

local highlighter_query = vim.treesitter.query.get and vim.treesitter.query.get(tree:lang(), "highlights") or vim.treesitter.query.get_query(tree:lang(), "highlights")
ybbond commented 1 year ago

@seblj I've added the ternary, and reminder comment. you may remove if you don't like TODOs I guess

please check 😄

seblj commented 1 year ago

Thank you!