Created
October 10, 2025 18:16
-
-
Save bishabosha/94da5f7b8b0f97589ceb6f5006389915 to your computer and use it in GitHub Desktop.
Zed configuration to extract main class fqn for Scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "label": "Scala run", | |
| "command": "scala", | |
| "args": [ | |
| "run", | |
| "-M", | |
| "$(if [ -z \"${ZED_CUSTOM_scala_package_name:}\" ] ; then echo \"$ZED_CUSTOM_scala_main_function_name\"; else echo \"${ZED_CUSTOM_scala_package_name:}.$ZED_CUSTOM_scala_main_function_name\"; fi)", | |
| "$ZED_WORKTREE_ROOT" | |
| ], | |
| "tags": ["scala-main"] | |
| } | |
| ] |
Author
Author
also depends on my in progress runnables.scm queries at https://github.com/bishabosha/metals-zed/blob/48365449106f99c4a72ebb6855f708a02e8a4505/languages/scala/runnables.scm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the task interpreter seems to have a critical flaw that any "optional" env var will cause the task to not run at all if it doesnt exist, so you have to do a higher level operation to escape it via
${ZED_CUSTOM_scala_package_name:}which basically means resorting to builtins to compare the length