zed
zed copied to clipboard
Ability to pass current file name to a task
Check for existing issues
- [X] Completed
Describe the feature
{
"label": "run",
"command": "python",
"args": ["{current_file}"],
}
If applicable, add mockups / screenshots to help present your vision of the feature
No response
We already have ZED_FILE, though we might want to enhance it with things like "worktree-relative path", "path-to-parent-directory" and so on.
There is a bug with the ZED_FILE, it only works for some extensions and doesn't work for other extensions.
Could you recheck this on Zed 0.132 (or above, if happens later) and, if the issue persists, provide more details — which language extensions do and do not have it for you?
Well, I am still on 0.131.6 and I don't think I can update it from Zed. However, it doesn't work with java files and text files.
I have a simple echo task, that outputs "$ZED_FILE" and it is often a blank line. It seems to work fine with python, markdown, and rust but the important part is that with Java, Julia, and text files it is just blank. It is also a blank line for files that don't have an extension at the end.
I'm going to close this issue out because we now support ZED_FILE - @wmstack, can you open up a new issue for the problem you are encountering?
Thanks, indeed files with languages that do not have tasks, have blank ZED_FILE on Stable and Preview improves the general logic, filtering such tasks away entirely.
I'll work on a fix, so maybe an issue is note really needed.
https://github.com/zed-industries/zed/pull/10764