extensions icon indicating copy to clipboard operation
extensions copied to clipboard

GDScript

Open Dan2552 opened this issue 2 years ago • 13 comments

Check for existing issues

  • [X] Completed

Language

GDScript

Tree Sitter parser link

No response

Language server link

https://github.com/godotengine/godot

Misc notes

Looks like the language server is with the engine/editor distribution itself

And looks like there was a bit of history around the language server being implemented in an odd way, but hopefully this resolves it https://github.com/godotengine/godot/pull/35864

Dan2552 avatar Jan 13 '23 23:01 Dan2552

And here is a GDScript tree-sitter parser (was implemented in helix-editor, written in Rust) https://github.com/helix-editor/helix/tree/6a323c0b1b8fd2491dcbca38b5a1f62bf9581da4/runtime/queries/gdscript

ghashy avatar Mar 28 '23 16:03 ghashy

I've found today another treesitter implemented: https://github.com/PrestonKnopp/tree-sitter-gdscript And there is one for the resources too here: https://github.com/PrestonKnopp/tree-sitter-godot-resource

The second one, was not updated in three years.

There is some documentation on how to create an extension or this stuff? I only found this: https://zed.dev/docs/adding-new-languages maybe because I never did anything like that, but I don't understand it

Dracks avatar Feb 23 '24 15:02 Dracks

Got a quick test working locally. Not sure how to publish it to Zed though. Also no LSP support yet as it is not yet opened up by Zed yet (correct me if I'm wrong). Screenshot 2024-02-26 at 10 37 51

To reproduce it yourself:

grndctrl avatar Feb 26 '24 09:02 grndctrl

Got a quick test working locally. Not sure how to publish it to Zed though. Also no LSP support yet as it is not yet opened up by Zed yet (correct me if I'm wrong). Screenshot 2024-02-26 at 10 37 51

To reproduce it yourself:

  • Build a wasm from https://github.com/PrestonKnopp/tree-sitter-gdscript using tree-sitter-cli.
  • Create a gdscript extension folder in /Users/markbrand/Library/Application Support/Zed/extensions/installed (See other extensions to recreate the folder/file structure)
  • put the compiled wasm under grammars/gdscript.wasm
  • copy the scm files from https://github.com/helix-editor/helix/tree/6a323c0b1b8fd2491dcbca38b5a1f62bf9581da4/runtime/queries/gdscript in languages/gdscript/...
  • Reload Zed

Hey @grndctrl - you can publish by opening a PR within this repo - check out this PR as an example.

And yes, you are correct, we don't have language server support in extensions yet, but it is being worked on.

JosephTLyons avatar Feb 26 '24 16:02 JosephTLyons

Thanks @JosephTLyons for pointing me in the right direction, I created a PR #219

grndctrl avatar Feb 26 '24 18:02 grndctrl

@JosephTLyons apologies for the tag, but this one can be closed now right?

I was just looking at working on some of the top requests and don't have a way to close completed ones 👀

eth0net avatar Apr 17 '24 07:04 eth0net

@eth0net I think we're waiting for language server support which isn't available to zed extensions yet.

moomerman avatar Apr 17 '24 07:04 moomerman

Ah sorry I missed that, my bad! Language servers are now supported however 🚀

eth0net avatar Apr 17 '24 07:04 eth0net

Hi, I'm the one who threw together the GDScript extension, I haven't found the time yet to implement the LSP. I really want to, although I never really built something in Rust. If anyone has a good example from which I can work, I'll try to fit it in my schedule. Or have a stab at it when I'm on paternity leave soon.

grndctrl avatar Apr 17 '24 07:04 grndctrl

@grndctrl a good place to find examples is in the extensions repo itself. Check it out locally with submodules included and you can see all the other submitted extensions, all the ones I've looked into were licensed permissively so you can use those as references :)

There are also some docs on implementing language server extensions in AUTHORING_EXTENSIONS.md.

eth0net avatar Apr 17 '24 08:04 eth0net

Language servers are now supported however 🚀

ah thanks! I had missed that

moomerman avatar Apr 17 '24 08:04 moomerman

@grndctrl I submitted a PR (https://github.com/grndctrl/zed-gdscript/pull/2) with a simple working integration. Happy to take feedback there, or feel free to use it as a working example to build upon.

moomerman avatar Apr 17 '24 09:04 moomerman

@moomerman Thank you so much! I will look into this later.

grndctrl avatar Apr 17 '24 10:04 grndctrl

Language server support was added in https://github.com/zed-industries/extensions/pull/594.

I think we're good to close this out.

maxdeviant avatar Jul 01 '24 14:07 maxdeviant