tree-sitter-grammars / tree-sitter-markdown

Markdown grammar for tree-sitter
MIT License
379 stars 45 forks source link

No `code_span` nodes after latest update #45

Open Galicarnax opened 2 years ago

Galicarnax commented 2 years ago

After I synced neovim's packer, it updated the markdown parser, and it stopped working for me, since I use code_span and code_span_delimiter nodes in my custom queries. On another machine, where I did not update, I see with the TSPlayground that these nodes are there, but with updated parser, they are just gone. Is it intentional, and your parser will not recognize code spans like this one any more?

MDeiml commented 2 years ago

The parser was split into two grammars. You need to install the markdown_inline grammar as well. Your queries regarding code_span belong in the queries/markdown_inline folder. You can edit them using e.g. :TSEditQuery highlights markdown_inline. Sorry for the confusion.

MDeiml commented 2 years ago

I hope that answered your question, but I'll leave this open since other people probably will experience similar problems.

Galicarnax commented 2 years ago

Yes, installing markdown_inline solved it. Thanks!

msvechla commented 2 years ago

Thanks, I had the same issue. The following nvim-treesitter config fixed it for me:

parser_config.markdown = {
  install_info = {
    url = "https://github.com/MDeiml/tree-sitter-markdown",
    files = { "tree-sitter-markdown/src/parser.c", "tree-sitter-markdown/src/scanner.cc" },
  },
  filetype = "markdown",
}

parser_config.markdown_inline = {
  install_info = {
    url = "https://github.com/MDeiml/tree-sitter-markdown",
    files = { "tree-sitter-markdown-inline/src/parser.c", "tree-sitter-markdown-inline/src/scanner.cc" },
  },
  filetype = "markdown",
}