I understand that the Chrome-based option doesn't really let you do this because it'd have to be able to execute arbitrary code, which would violate the browser environment safety. However, I'm running the standalone. Things like cmake etc would be cool, but with how finnicky they can be I'm mostly interested in running build or test for Go and Rust. Most editors I just switch to the command line, but with Zed I really like having it fullscreen, so it would be nice to do be able to get compile errors/unit test failures automatically shown in a split and edit/recompile within the editor.
With Rust, I tried adding a Tools:Cargo Build command, but it doesn't seem to do anything (and if it does, there's no feedback).
To my user.config I added:
modes: {
rust: {
commands: {
"Tools:Cargo Build": {
scriptUrl: "/cargobuild.js"
}
}
}
},
For my javascript (warning: I do not know javascript, I mostly grabbed this from Stack Overflow, sorry if it's terrible)
var exec = require('child_process').exec, child;
child = exec('cargo build',
function (error, stdout, stderr) {
console.log('stdout: ' + stdout);
console.log('stderr: ' + stderr);
if (error !== null) {
console.log('exec error: ' + error)
}
});
One of the main issues here is I don't know if Zed's scripts set some sort of project root variable, because it would be necessary to run these commands (in Rust at least) from the project root. Go is a bit more complex because you need to run from arbitrary folders. Zed also appears to not display anything from console outputs, not even in zed::log.
Is there any way to use plugins to integrate arbitrary build/test tools into Zed (with the caveat that I'm running the standalone version)?