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

bug: Latex injections appear multiple times in AST #147

Open
1 of 2 tasks
camoz opened this issue May 7, 2024 · 1 comment
Open
1 of 2 tasks

bug: Latex injections appear multiple times in AST #147

camoz opened this issue May 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@camoz
Copy link

camoz commented May 7, 2024

Did you check existing issues?

  • I have read all the tree-sitter docs if it relates to using the parser
  • I have searched the existing issues

Describe the bug

When I edit a markdown file, latex injections appear multiple times in the AST shown by :InspectTree. I'm not sure if this is a bug, but it seems weird and I wanted to report it.

Steps To Reproduce/Bad Parse Tree

  1. Have nvim-treesitter plugin with markdown* and latex parsers installed
  2. :set ft=markdown
  3. paste
    some text
    
    $\alpha = 1$
    
  4. :InspectTree

Result: The inline math is present multiple times in the AST, specifically it is present where the cursor is in the picture below. If there are n paragraphs before the inline math in the markdown file, the inline math is is present n+1 times in the AST.

screen_2024-05-07_051336

Additional Info

  • Neovim: Tried with 0.9.5 and nightly
  • nvim-treesitter 19c6b0c4c9b35962e45b782e2b85a3214d2ac4d5 (2024 Apr 25)

Expected Behavior/Parse Tree

I would expect the inline math to show only once in the AST.

@camoz camoz added the bug Something isn't working label May 7, 2024
@ribru17
Copy link

ribru17 commented Jun 4, 2024

I think this might be an issue with the neovim injection logic, tree-sitter parse gives the correct AST (at least when looking at just the (latex_block) nodes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants