rust-lang / rust-enhanced

The official Sublime Text 4 package for the Rust Programming Language
MIT License
780 stars 104 forks source link

Feature request: Limit the number of threads used #439

Closed ckaran closed 4 years ago

ckaran commented 4 years ago

This is a feature request. Can you please put in a setting similar to -j to limit the number of threads used by rust-enhanced when running cargo? I have other threads that have soft-realtime requirements that are running simultaneously, and they start to choke up whenever I save my code. I've tested to make sure that running cargo build --release -j 4 does the right thing, so I know that this method will work.

ehuss commented 4 years ago

You can set flags via the config system. Docs are here. For example, "Rust: Configure Cargo Build" > "Set Extra Cargo Arguments" > "...in this Sublime Project" > "before -- separator" > -j2. An alternative is to set an environment variable CARGO_BUILD_JOBS in the config system.

ckaran commented 4 years ago

That seems to work, thank you!