You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I recently found out about https://rust-script.org/, which sounds like a great substitution for shell/python scripts that I have a ton of. I made my first Rust script a few days ago and it is awesome. The problem is that rust-analyzer only works with cargo projects and doesn't help when a single-file project is opened. But another issue is that to make the script "portable" you have to include dependencies in the Rust file:
And I was wondering if it will be possible to make this plugin work with this embedded version of Cargo.toml's dependencies. I have to modify dependencies in the Cargo.toml first and then copy/sync them with the rust-script's place for those dependencies. If this plugin can work right in the Rust file, then I would only have to open a single file, which makes the workflow much simpler and quicker. (Though for rust-analyzer to work, I would still have to modify Cargo.toml...oh well...)
The text was updated successfully, but these errors were encountered:
As for crates.nvim it should be possible, but will be a decent amount of work. I'm currently debating whether to rewrite this whole plugin in rust or using https://github.com/saecki/crates-nvim-rs just as the toml parser. Until then it's unlikely though not impossible that I will implement this feature.
But it only works with the standard Rust and is still useless for when using the third-party libraries. Although, if there is no Cargo.toml to check the dependencies from, how would it know which libraries to load. Would be cool if rust-analyzer can read the rust-scripts's in source file dependencies. Then all the problems would be solved.
Until then it's unlikely though not impossible that I will implement this feature.
Hello. I recently found out about https://rust-script.org/, which sounds like a great substitution for shell/python scripts that I have a ton of. I made my first Rust script a few days ago and it is awesome. The problem is that rust-analyzer only works with cargo projects and doesn't help when a single-file project is opened. But another issue is that to make the script "portable" you have to include dependencies in the Rust file:
And I was wondering if it will be possible to make this plugin work with this embedded version of Cargo.toml's dependencies. I have to modify dependencies in the Cargo.toml first and then copy/sync them with the rust-script's place for those dependencies. If this plugin can work right in the Rust file, then I would only have to open a single file, which makes the workflow much simpler and quicker. (Though for rust-analyzer to work, I would still have to modify Cargo.toml...oh well...)
The text was updated successfully, but these errors were encountered: