powerlevel9k icon indicating copy to clipboard operation
powerlevel9k copied to clipboard

[Enhancement] Only show rust version status when in a rust project directory or subdirectory

Open loganintech opened this issue 6 years ago • 2 comments

Only show rust status in a rust project folder

Description

Similar to how the go information only displays when in a go source directory, rust info should only show up when in a rust project. This leverages Rust's package manager Cargo. Specifically, it runs cargo pkgid which would normally print the fully qualified package information of the current working directory's project. However, when not in a rust project and none of the parent directories contain Cargo.toml it prints error:. This simply checks if error was printed by Cargo and assumes we're not in a rust project because of it.

Questions

  1. I will need assistance with unit tests.
  2. I'm not really sure if this is the right branch to merge onto (master to master) but it's a pretty small change
  3. I'd like input on whether or not using Cargo as an underlying driver for this will work for the majority of people. Cargo is one of the best package managers I've used and most if not all rust users I know take advantage of it, meaning it's on their machines. However, this requires an outside tool and I'd understand if that would want to be avoided.

Related issue (that I filed) https://github.com/bhilburn/powerlevel9k/issues/1180

loganintech avatar Mar 06 '19 09:03 loganintech

@dritter what do you think about this?

loganintech avatar Apr 23 '19 05:04 loganintech

Excited to see this happen. While at the moment, it feels like having a date for the installed nightly version would make the status indicator more useful, it'd be great to have it only show up in Rust projects to start.

evanjs avatar Jul 29 '19 13:07 evanjs