Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

debugger: Add support for running test methods with function receiver in Go (#34613)

Umesh Yadavb4dc7f8a8aad
diff --git a/crates/languages/src/go/runnables.scm b/crates/languages/src/go/runnables.scm
index 8d5f4375c13..bdeb77b46c8 100644
--- a/crates/languages/src/go/runnables.scm
+++ b/crates/languages/src/go/runnables.scm
@@ -1,9 +1,21 @@
; Functions names start with `Test`
(
- (
+ [
(function_declaration name: (_) @run
(#match? @run "^Test.*"))
- ) @_
+ (method_declaration
+ receiver: (parameter_list
+ (parameter_declaration
+ name: (identifier) @_receiver_name
+ type: [
+ (pointer_type (type_identifier) @_receiver_type)
+ (type_identifier) @_receiver_type
+ ]
+ )
+ )
+ name: (field_identifier) @run @_method_name
+ (#match? @_method_name "^Test.*"))
+ ] @_
(#set! tag go-test)
)