tree-sitter-grammars / tree-sitter-hyprlang

hyprlang grammar for tree-sitter
MIT License
103 stars 2 forks source link

Unable to install parser #15

Closed mamaraddio closed 3 months ago

mamaraddio commented 3 months ago

Did you check existing issues?

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

No response

Describe the bug

Unable to install the parser using nvim-treesitter.

Following the README.md file of this repo it states

You can install the hyprlang parser in neovim using nvim-treesitter and use the following code snippet for automatic filetype detection

So I paste the snippet for automatic filetype detection to my neovim config and try to install the parser via :TSInstall command

It does not work. So I add this repo as a plugin to my neovim config but nothing happens. So againg (whit this repo as plugin added to my config) I issue again :TSInstall hyprlang but it doesn't work.

Fortunately I remembered a old version of this plugin that had a snippet for manual parser configuration and try to add that snippet (of course with the relevant modifications to repo URL). So I added this repo as a plugin to my neovim config, configured the automatic filetype detection and issued again :TSInstall hyprlang and it just worked.

Maybe you should add these steps to your README.md file? Just to make simple for new users to install this parser.

Steps To Reproduce/Bad Parse Tree

  1. add automatic filetype detection to neovim config
  2. issue :TSInstall hyprlang in neovim

Expected Behavior/Parse Tree

Based on what the README states the parser should be installed automatically

Repro

No response

clason commented 3 months ago

You need nvim-treesitter for :TSInstall, so this issue is out of scope here. If installation fails, please report it there with full details (or reach out on Matrix for help).

mamaraddio commented 3 months ago

You need nvim-treesitter for :TSInstall, so this issue is out of scope here. If installation fails, please report it there with full details (or reach out on Matrix for help).

I have nvim-treesitter installed, otherwise how do you think I could isssued :TSInstall hyprlang without nvim-treesitter?

clason commented 3 months ago

My point is:

  1. why are you opening an issue about nvim-treesitter not working correctly here?
  2. that adding this repo as a plugin not working is expected; there's nothing here that is relevant to parser installation in Neovim.
mamaraddio commented 3 months ago

why are you opening an issue about nvim-treesitter not working correctly here?

Because if I go read the nvim-treesitter documentation for hyprlang parser I can find it in "Supported languages" so I think I can just :TSInstall hyprlang but this does not work. So I read the entire line

  • [x] hyprlang (maintained by @luckasRanarison)

and clicking on the link it redirects me here, were I suppose the maintainers could help me.

If you think this is not the right place where to open am issue could you (as the mainteners of this parser) create an issue or a PR into the right place, or at least just tell what the right place is just a moment before closing the issue as not planned just because "this is not my issue", (wrongly) supposing I was missing the base plugin. My description clearly implies that I have it installed (otherwise :TSInstall will not be available as a command and the "manual parser configuration" would have caused tons of errors in my neovim just when the line require("nvim-treesitter.parsers").get_parser_configs() were be loaded)

that adding this repo as a plugin not working is expected; there's nothing here that is relevant to parser installation in Neovim.

If I remove this repo from my plugins the parser doesn't work again, maybe here there is nothing relevant but that's the way it is.

Not too bad I was able to install the parser and make it work at the end, and this Issue I opened here can help others if they face the same issue in future but, only my thought - no dramas, I think you might have handled it slightly better in just a couple of minutes.

clason commented 3 months ago

Sigh.

  1. I am telling you that nvim-treesitter is the correct repo for this because you have installed it and it's not working; and nobody can open this issue for you since you (and only you) have this problem (I can :TSInstall hyprlang just fine).
  2. Your assumption that this link leads you to the correct repo to open an issue was wrong (honest mistake to make, but this doesn't make it correct).
  3. Adding this repo as a plugin has nothing to do with, neither helping nor hurting (for installing parsers -- it will break queries once the parser is installed, mind you).