nvim-treesitter / playground

Treesitter playground integrated into Neovim
Apache License 2.0
898 stars 47 forks source link

TSPlayground issue with markdown + markdown_inline #106

Closed semanticart closed 1 year ago

semanticart commented 1 year ago

I'm running Treesitter w/ latest neovim and using the markdown and markdown_inline parsers. Everything works great with that setup and they show up with checkmarks when I do :checkhealth

Parser/Features         H L F I J
  - markdown_inline     ✓ . . . ✓
  - markdown            ✓ . ✓ . ✓

When trying to write a query using :TSPlaygroundToggle's query editor that targets a node provided by markdown_inline, the query doesn't work and I get an "Invalid Node Type" error. Targeting nodes from the markdown parser works fine.

Here's some example markdown

# hello

[[google]]

[google]: http://google.com

And here's an example offending query

(atx_h1_marker) @h1
(shortcut_link) @slink

The @h1 capture works fine on its own. shortcut_link is an "Invalid Node Type".

Is there a way to tell the playground query editor to consider nodes from both markdown and markdown_inline here?

screenshot

semanticart commented 1 year ago

Adk9p on reddit helped me understand that I needed to press f to focus the markdown_inline section. I didn't grok that in the docs.