go: Add runnables (#12110)
This adds support for runnables to Go. It adds the following tasks: - `go test $ZED_GO_PACKAGE -run $ZED_SYMBOL` - `go test $ZED_GO_PACKAGE` - `go test ./...` - `go run $ZED_GO_PACKAGE` if it has a `main` function Release Notes: - Added built-in Go runnables and tasks that allow users to run Go test functions, test packages, or run `main` functions. Demo: https://github.com/zed-industries/zed/assets/1185253/a6271d80-faf4-466a-bf63-efbec8fe6c35 https://github.com/zed-industries/zed/assets/1185253/92f2b616-7501-463d-b613-1ec1084ae0cd
This commit is contained in:
parent
e5b9e2044e
commit
8168ec2a28
3 changed files with 104 additions and 3 deletions
9
crates/languages/src/go/runnables.scm
Normal file
9
crates/languages/src/go/runnables.scm
Normal file
|
@ -0,0 +1,9 @@
|
|||
(
|
||||
(function_declaration name: (_) @run
|
||||
(#match? @run "^Test.*"))
|
||||
) @go-test
|
||||
|
||||
(
|
||||
(function_declaration name: (_) @run
|
||||
(#eq? @run "main"))
|
||||
) @go-main
|
Loading…
Add table
Add a link
Reference in a new issue