gleam-lang / tree-sitter-gleam

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

add tags.scm queries #15

Closed the-mikedavis closed 2 years ago

the-mikedavis commented 2 years ago

connects #14

I'm not sure I got them all, plus I'd like to add some tests (see https://github.com/tree-sitter/tree-sitter/pull/1547). This PR makes me think that maybe the pub visibility qualifier might want to be its own node under type_definition or function definitions? I think that might simplify the queries but I don't know if that's a good enough reason to refactor nodes. (Also, I use tree-sitter nodes for motion in my editor (see https://github.com/helix-editor/helix/pull/1495) and I think jumping to the pub token could occassionally be valuable, wydt?)

the-mikedavis commented 2 years ago

Ah interesting. I saw a fn when I was testing and decided to look the other way 😄

I think it's ok for these tags to only work on blatantly obvious function/module/type constructs. That is probably something I would want to cover when writing stack-graphs queries for precise navigation