Define tasks for specific files/languages #28261
Testare
started this conversation in
Feature Ideas / Enhancements
Replies: 2 comments
-
|
I need this feature. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
need this too, I wanna a coder runner config, but I can't find var to check what language was used |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Idea
I think it would be nice if we could have language specific tasks defined, similar to how you can change settings for specific languages in settings.
In particular, I like the
"reveal": "no_focus"option for tasks, such as cargo tests, but the built-in ones focus the terminal after running. My work-around is to redefine these tasks, which is essentially copy-pasting how the cargo test tasks behave with the one setting changed, but now these tasks are available even in non-rust contexts.Consequently, being able to override task settings would also solve this issue and involve less copy-paste, but might be a bit more niche than simply defining tasks for specific languages.
API ideas
tasks.jsonsupports having a base object, where the "default" key maps to global tasks but different languages can act as different keys. If the base object is an array, treat everything like the "default" key.I think the first one makes the most sense, but I'm not familiar with zed code-base.
Open questions
What if a project has multiple languages in the project? For example, if you're editting Cargo.toml or Readme.md, building a rust project still makes sense as a task even if the current file is not a rust file.
Beta Was this translation helpful? Give feedback.
All reactions