helix icon indicating copy to clipboard operation
helix copied to clipboard

Update scala treesitter grammar

Open olynch opened this issue 3 years ago • 3 comments

This should address #4352.

olynch avatar Oct 18 '22 18:10 olynch

This doesn't seem to fix the syntax highlighting for me with the test file mentioned:

$ cat << EOF >> ~/.config/helix/languages.toml
[[grammar]]
name = "scala"
source = { git = "https://github.com/tree-sitter/tree-sitter-scala", rev = "140c96cf398693189d4e50f76d19ddfcd8a018f8" }
EOF

$ hx -g fetch
$ hx -g build

sudormrfbin avatar Oct 18 '22 18:10 sudormrfbin

It looks like this is the block that fails to be parsed correctly:

def updateModel[Model](f: Model => Model): Action[Model, Unit] = for {
  $model <- ops[Model].ask.map(_.$model)
  _ <- ops.delay($model.update(f))
} yield {}

I think it's the _.$model but I don't know much about scala.

Fixing #4352 will need more changes to tree-sitter-scala. We could still merge this as-is though, it looks like there have been a few changes to the parser code that may fix parsing in some other cases.

the-mikedavis avatar Oct 18 '22 23:10 the-mikedavis

Yeah, that's what I was thinking. There are other glitches that I've seen, and so I think this will fix something.

olynch avatar Oct 24 '22 13:10 olynch