Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elixir: Add runnable tasks #12526

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions extensions/elixir/languages/elixir/runnables.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
; Macros `describe` and `test`.
; This matches the ExUnit test style.
(
(call
target: (identifier) @run (#any-of? @run "describe" "test")
) @elixir-test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
) @elixir-test
) @_elixir-test

(#set! tag elixir-test)
)

; Modules containing at least one `describe` or `test`.
; This matches the ExUnit test style.
(
(call
target: (identifier) @run (#eq? @run "defmodule")
(do_block
(call target: (identifier) @keyword (#any-of? @keyword "describe" "test"))
)
) @elixir-module-test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(call target: (identifier) @keyword (#any-of? @keyword "describe" "test"))
)
) @elixir-module-test
(call target: (identifier) @_keyword (#any-of? @_keyword "describe" "test"))
)
) @_elixir-module-test

(#set! tag elixir-module-test)
)
6 changes: 4 additions & 2 deletions extensions/elixir/languages/elixir/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
{
"label": "mix test $ZED_RELATIVE_FILE",
"command": "mix",
"args": ["test", "$ZED_RELATIVE_FILE"]
"args": ["test", "$ZED_RELATIVE_FILE"],
"tags": ["elixir-module-test"]
},
{
"label": "mix test $ZED_RELATIVE_FILE:$ZED_ROW",
"command": "mix",
"args": ["test", "$ZED_RELATIVE_FILE:$ZED_ROW"]
"args": ["test", "$ZED_RELATIVE_FILE:$ZED_ROW"],
"tags": ["elixir-test"]
},
{
"label": "Elixir: break line",
Expand Down