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

No parser for typescriptreact language (when treesitter parser name is different from filetype) #17

Closed
Gelio opened this issue Jun 14, 2022 · 1 comment

Comments

@Gelio
Copy link

Gelio commented Jun 14, 2022

When trying to use nvim-treehopper in a tsx file, I get the following error:

E5108: Error executing lua ...local/share/nvim/runtime/lua/vim/treesitter/language.lua:25: no parser for
 'typescriptreact' language, see :help treesitter-parsers
stack traceback:
        [C]: in function 'error'
        ...local/share/nvim/runtime/lua/vim/treesitter/language.lua:25: in function 'require_language'
        /usr/local/share/nvim/runtime/lua/vim/treesitter.lua:39: in function '_create_parser'
        /usr/local/share/nvim/runtime/lua/vim/treesitter.lua:98: in function 'get_parser'
        ...nvim/site/pack/packer/start/nvim-treehopper/lua/tsht.lua:53: in function 'nodes'
        [string ":lua"]:1: in main chunk
Press ENTER or type command to continue
Peek.2022-06-11.11-02.mp4

This seems to be caused by the treesitter parser for the typescriptreact filetype being named tsx. nvim-treehopper tries to use the parser with the same name as the filetype, which is not the case for quite a few filetypes, as shown in nvim-treesitter.

I have decided to report this issue separately from my attempt at solving it (#14), since the progress on that PR has stifled while the issue remains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants