Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: tree-sitter get_query deprecated on nvim 0.10.0 + #539

Closed
3 tasks done
WillEhrendreich opened this issue Jul 18, 2023 · 2 comments · Fixed by #540 or #639
Closed
3 tasks done

bug: tree-sitter get_query deprecated on nvim 0.10.0 + #539

WillEhrendreich opened this issue Jul 18, 2023 · 2 comments · Fixed by #540 or #639
Labels
bug Something isn't working

Comments

@WillEhrendreich
Copy link

Did you check docs and existing issues?

  • I have read all the noice.nvim docs
  • I have searched the existing issues of noice.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.10.0-dev-579+gcd6458123

Operating system/version

Windows 10

Describe the bug

 Warn 1:23:29 PM notify.warn vim.treesitter.query.get_query() is deprecated, use vim.treesitter.query.get() instead. :help deprecated
This feature will be removed in Nvim version 0.10
 Warn 1:23:30 PM notify.warn stack traceback:
C:/Neovim/share/nvim/runtime/lua/vim/treesitter/query.lua:200: in function 'get_query'
.../nvim-data/lazy/noice.nvim/lua/noice/text/treesitter.lua:26: in function 'get_query'
.../nvim-data/lazy/noice.nvim/lua/noice/text/treesitter.lua:68: in function 'fn'
...m/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:385: in function 'for_each_tree'
.../nvim-data/lazy/noice.nvim/lua/noice/text/treesitter.lua:64: in function 'highlight'
.../share/nvim-data/lazy/noice.nvim/lua/noice/text/init.lua:67: in function 'highlight'
...ocal/share/nvim-data/lazy/nui.nvim/lua/nui/line/init.lua:58: in function 'highlight'
...ocal/share/nvim-data/lazy/nui.nvim/lua/nui/line/init.lua:73: in function 'render'
...share/nvim-data/lazy/noice.nvim/lua/noice/text/block.lua:98: in function 'render'
...are/nvim-data/lazy/noice.nvim/lua/noice/lsp/override.lua:48: in function 'stylize_markdown'
...local/share/nvim-data/lazy/hover.nvim/lua/hover/util.lua:295: in function 'open_floating_preview'
...al/share/nvim-data/lazy/hover.nvim/lua/hover/actions.lua:133: in function 'show_hover'
...al/share/nvim-data/lazy/hover.nvim/lua/hover/actions.lua:156: in function 'run_provider'
...al/share/nvim-data/lazy/hover.nvim/lua/hover/actions.lua:181: in function <...al/share/nvim-data/lazy/hover.nvim/lua/hover/actions.lua:176>

Steps To Reproduce

just got it off of a hover request, but anything that calls vim.treesitter.query.get_query() should do it, if noice is overriding stylize markdown.

Expected Behavior

shouldn't use the older function call on newer nvim.

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  "folke/noice.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
@WillEhrendreich WillEhrendreich added the bug Something isn't working label Jul 18, 2023
@folke folke closed this as completed in e91a31c Jul 18, 2023
@WillEhrendreich
Copy link
Author

well.. fine... then.. jus... just.. be all speedy and helpful like that.. lol. thanks.

@folke
Copy link
Owner

folke commented Jul 19, 2023

I already added code to skip the deprecated functions, but the code was wrong :)

willothy pushed a commit to willothy/noice.nvim that referenced this issue Aug 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants