tree-sitter / tree-sitter-scala

Scala grammar for tree-sitter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nested comments break syntax hightlight in nvim treesitter

antosha417 opened this issue · comments

Commit of tree-sitter-scala you tested this on

latest

A code sample showing the error

package bla

// /*
//  * This is awesome comment
//  */
// case class Foo()

case class Bla()
Screenshot 2023-06-12 at 13 03 07 Screenshot 2023-06-12 at 13 03 25

Show the error node

package_clause [0, 0] - [0, 11]
  name: package_identifier [0, 8] - [0, 11]
    identifier [0, 8] - [0, 11]
ERROR [2, 0] - [9, 0]
  comment [3, 0] - [3, 29]
  comment [4, 0] - [4, 6]
  comment [5, 0] - [5, 19]

What do you expect the tree to look like

I want syntax highlighting to work even when there are nested comments

Where are you experiencing this error?

nvim-treesitter

@antosha417 Thanks for reporting!