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

added parser init for treesitter to nvim plugin #9

Merged
merged 5 commits into from
Jan 3, 2024

Conversation

aserowy
Copy link
Contributor

@aserowy aserowy commented Jan 3, 2024

closes #8

@luckasRanarison
Copy link
Collaborator

I think we should also update the readme, and by the way does this affect the Nix configuration? I don't use nix and I wasn't the one who made it.

(Asking because you seem to also use nix)

@aserowy
Copy link
Contributor Author

aserowy commented Jan 3, 2024

I think we should also update the readme, and by the way does this affect the Nix configuration? I don't use nix and I wasn't the one who made it.

(Asking because you seem to also use nix)

Hi,

i updated the readme. The nix code looks fine (i cannot test it, because my nvim config is not nixified). It should run better now, because the initialization was missing there as well.

After looking into the flake, the parser seems to get appended to the lua while building. I will test it and get back with more infos.

@aserowy
Copy link
Contributor Author

aserowy commented Jan 3, 2024

Ok, we got it :). On the downside we must seperate both configurations to be able to use two different kind of inits. The normal plugin uses the 'normal' way of registering the parser. Nix on the other hand builds the parser and query on its own and registers the builded one directly.

Building the flake gives now the following output again.

󱄅 󰎑 󰉋 tree-sitter-hypr at 󰊤 on 󰘬 master !1 is 󰏗 v1.0.0 via  via 󱘗 took 2s 
11:23:28 : open result/plugin/init.lua
vim.filetype.add({
  pattern = { [".*/hypr/.*%.conf"] = "hypr" },
})

vim.api.nvim_create_autocmd("FileType", {
  pattern = "hypr",
  callback = function(event) vim.bo[event.buf].commentstring = "# %s" end,
})

vim.treesitter.language.require_language("hypr", "/nix/store/c5sn8bqfh9spipqq6yrac4hl49ldm461-hypr-g
rammar-v1.0.2/parser")

@luckasRanarison luckasRanarison merged commit 5ce9847 into tree-sitter-grammars:master Jan 3, 2024
1 check passed
@luckasRanarison
Copy link
Collaborator

Thanks a lot for your PR!

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

Successfully merging this pull request may close these issues.

Initialization code missing in nvim plugin?
2 participants