File tree 5 files changed +62
-1
lines changed
5 files changed +62
-1
lines changed Original file line number Diff line number Diff line change 1
1
.DS_Store
2
+
2
3
gdscript.wasm
3
- test.gd
4
+ extension.wasm
4
5
grammars
6
+ test.gd
7
+
8
+ debug
9
+ target
10
+ Cargo.lock
Original file line number Diff line number Diff line change
1
+ [package ]
2
+ name = " zed_gdscript"
3
+ version = " 0.0.1"
4
+ edition = " 2021"
5
+ publish = false
6
+ license = " MIT"
7
+
8
+ # [lints]
9
+ # workspace = true
10
+
11
+ [lib ]
12
+ path = " src/gdscript.rs"
13
+ crate-type = [" cdylib" ]
14
+
15
+ [dependencies ]
16
+ zed_extension_api = " 0.0.6"
Original file line number Diff line number Diff line change 1
1
# Zed GDScript
2
2
3
3
This extension adds support for the [ GDScript] ( https://docs.godotengine.org/en/stable/classes/index.html ) language.
4
+
5
+ ## Language Server Protocol
6
+
7
+ Support for the Godot Language Server Protocol (LSP) is provided via ` nc ` which is assumed to be in your ` PATH ` .
8
+
9
+ The language server is expected to be running on the default ip ` 127.0.0.1 ` and port ` 6005 ` .
Original file line number Diff line number Diff line change 6
6
description = " GDScript language support for Zed"
7
7
repository = " https://github.com/grndctrl/zed-gdscript"
8
8
9
+ [language_servers .gdscript ]
10
+ name = " GDScript Language Server"
11
+ language = " GDScript"
12
+
9
13
[grammars .gdscript ]
10
14
repository = " https://github.com/PrestonKnopp/tree-sitter-gdscript"
11
15
commit = " b5dea4d852db65f0872d849c24533eb121e03c76"
16
+
Original file line number Diff line number Diff line change
1
+ use zed:: LanguageServerId ;
2
+ use zed_extension_api:: { self as zed, Result } ;
3
+
4
+ struct GDScriptExtension ;
5
+
6
+ impl zed:: Extension for GDScriptExtension {
7
+ fn new ( ) -> Self {
8
+ Self
9
+ }
10
+
11
+ fn language_server_command (
12
+ & mut self ,
13
+ _language_server_id : & LanguageServerId ,
14
+ worktree : & zed:: Worktree ,
15
+ ) -> Result < zed:: Command > {
16
+ let path = worktree
17
+ . which ( "nc" )
18
+ . ok_or_else ( || "nc must be installed and available on your $PATH" . to_string ( ) ) ?;
19
+
20
+ Ok ( zed:: Command {
21
+ command : path,
22
+ args : vec ! [ "127.0.0.1" . to_string( ) , "6005" . to_string( ) ] ,
23
+ env : Default :: default ( ) ,
24
+ } )
25
+ }
26
+ }
27
+
28
+ zed:: register_extension!( GDScriptExtension ) ;
You can’t perform that action at this time.
0 commit comments