zed
zed copied to clipboard
elixir: Fix `mix test $ZED_SYMBOL` task
$ZED_SYMBOL doesn't really work here once that will try to do something like this:
mix test MyModule.MyModuleTest
instead of using the path of the file:
mix test test/my_module/my_module_test.exs
Release Notes:
- N/A
We require contributors to sign our Contributor License Agreement, and we don't have @feliperenan on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.
@cla-bot check
We require contributors to sign our Contributor License Agreement, and we don't have @feliperenan on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.
The cla-bot has been summoned, and re-checked this pull request!
@cla-bot check
The cla-bot has been summoned, and re-checked this pull request!
This must have gotten broken during the recent move of elixir support into an extension. I already had my own elixir tasks so didn't notice. As you mention, it would be nice to have something like $ZED_RELATIVE_PATH. A relative path is also necessary for using the browse functionality of the Github CLI (https://cli.github.com/manual/gh_browse).
I've added ZED_RELATIVE_FILE in https://github.com/zed-industries/zed/pull/12245
Thank you @osiewicz. I just tested and it works like a charm. Just updated this PR to use ZED_RELATIVE_FILE as well.
@feliperenan - I'm curious if you'd be open to a PR that renames the label for these tasks to not use the variables. I found that I had to redefine the tasks locally so that I could bind my keymaps to spawn them. Eg:
", r c": ["task::Spawn", { "task_name": "mix test nearest" }]
although using the task_name: mix test $ZED_RELATIVE_FILE:$ZED_ROW does work its a bit more obscure to find (had to search through the code to see what variables exactly were being used)