GDQuest / zed-gdscript

Zed support for the GDScript language
MIT License
37 stars 10 forks source link

Improve the GDScript outlines #22

Closed NathanLovato closed 3 months ago

NathanLovato commented 3 months ago

The extension supports GDScript outlines starting at version 0.4. It captures all the function definitions, inner classes, enums, constants, signals, and variables.

However, there are a couple of improvements we could make:

If someone has experience with tree sitter grammars, I'd love some insights on how this is usually achieved. For the first task, the GDScript parser has special nodes for onready and exported variables but I don't know how to display the @export and @onready annotations in the outline yet.

For the second, I tried using negated predicates like #not-match and negating the query with ! but couldn't make it work yet.

fstxz commented 3 months ago

Variables are duplicated when there is a @tool in the script. image

NathanLovato commented 3 months ago

Thanks! I opened a bug ticket about this.