gleam-lang / tree-sitter-gleam

🌳 A tree-sitter grammar for the Gleam programming language
Apache License 2.0
66 stars 13 forks source link

This query could not be parsed "try" #76

Closed philipgiuliani closed 9 months ago

philipgiuliani commented 9 months ago

When opening a gleam file with the latest commit, I get the following error:

This query could not be parsed: QueryError { row: 96, column: 3, offset: 2086, message: "try", kind: NodeType }

The Version 0.32.0 works fine, it has broken after that commit. Example file: https://github.com/philipgiuliani/glubs/blob/55edb1e95d6b8ec66daa0e8aa2a13a008aeafad2/src/glubs/webvtt.gleam Editor: helix 23.10 (f6021dd0)

the-mikedavis commented 9 months ago

This is intentional: try was removed from Gleam a few minors ago and we fully removed the syntax from the parser in https://github.com/gleam-lang/tree-sitter-gleam/releases/tag/v0.32.0 (https://github.com/gleam-lang/tree-sitter-gleam/commit/23d2b896514087d97f75a62035b325a4704cbae5).

In general you can't change the revision of a tree-sitter grammar repository without also adjusting the highlights for the new changes to the parser. We maintain some example highlights in the repo under queries/highlights.scm that can be used as inspiration/suggestions when updating highlights in Helix (under runtime/queries/gleam/highlights.scm) or nvim