Open iamkartiknayak opened 2 weeks ago
I'm pretty sure other languages also have this feature, and you can manually implement it for other languages using the tasks system, but I am not familiar enough to help you
But it would be better to have this OOBE
@AlbertMarashi is right, this is already extendable. It would be great to have it out of the box, but so far nobody from the core team has written tasks for these languages. Contributions are most welcome. :)
I'm pretty sure other languages also have this feature, and you can manually implement it for other languages using the tasks system, but I am not familiar enough to help you
Hi @AlbertMarashi @osiewicz, Is there some documentation on how to extend this for other languages? would be happy to do this for java, scala etc.
maybe @maxdeviant can provide some guidance
I am not super familiar with the code, but I believe it is just combination of defining tasks and a tree-sitter query to identify areas which can be associated with that task.
Here is where the rust runnable task is defined and given the tag rust-main
https://github.com/zed-industries/zed/blob/cdead5760a2c200179e6a51d5a396c33a3e06e3d/crates/languages/src/rust.rs#L495-L512
And here is the tree-sitter runnables.scm which identifies the code which should be tagged rust-main
https://github.com/zed-industries/zed/blob/cdead5760a2c200179e6a51d5a396c33a3e06e3d/crates/languages/src/rust/runnables.scm#L29-L40
I recommend you take a look at the existing runnables.scm
for the various languages which have them and then search for the tag values (e.g. rust-test
, c-main
, go-test
, etc) to see the associated tasks. You should then also look at the git blame for those lines and you should be able to find the commits where that functionality was added and if there are additional requirements to get everything hooked up properly.
Check for existing issues
Describe the feature
Currently only Rust language seems to have the support for Run button to directly execute the file in terminal.
If applicable, add mockups / screenshots to help present your vision of the feature
No response