Abstract-IDE / Abstract

neovim as an IDE
https://abstract-ide.github.io/site/
MIT License
187 stars 13 forks source link

Neovim 0.9 filetype_to_parsername is deprecated #31

Closed doctorfree closed 1 year ago

doctorfree commented 1 year ago

It appears that in Neovim 0.9 filetype_to_parsername is deprecated and should be replaced with vim.treesitter.language.register

This causes a warning when starting Abstract with v0.9 or later. I think the following modification to lua/plugins/nvim-treesitter.lua will accomplish the same thing without warning:

-- local parsername = parsers.filetype_to_parsername
-- parsername.htmldjango = 'html' -- enable html parser in htmldjango file
-- parsername.zsh = 'bash' -- enable bash parser in zsh file
   vim.treesitter.language.register('html', 'htmldjango')
   vim.treesitter.language.register('bash', 'zsh')
doctorfree commented 1 year ago

The full error message indicates not only is filetype_to_parsername deprecated in Neovim 0.9 but the setup script apparently calls a couple of unknown options, open_on_setup and ignore_ft_on_setup:

filetype_to_parsername is deprecated, please use 'vim.treesitter.language.register'
[NvimTree] unknown option: open_on_setup | [NvimTree] unknown option: ignore_ft_on_setup | see :help nvim-tree-setup for available configuration options
shaeinst commented 1 year ago

@doctorfree I am very busy these days because of my exam. I will be free after 2 weeks

doctorfree commented 1 year ago

No rush. I maintain several projects and understand how these things go. Good luck on your exam!

shaeinst commented 1 year ago

@doctorfree can you please test with the latest commit ?

doctorfree commented 1 year ago

@shaeinst with the latest commit these warnings are no longer shown when using Neovim 0.9. Good work, closing.