Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Ensure we search in global paths on Windows #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

DonJayamanne
Copy link
Collaborator

No description provided.

@@ -38,7 +46,19 @@ impl Environment for EnvironmentApi {
get_env_var(key)
}
fn get_know_global_search_locations(&self) -> Vec<PathBuf> {
vec![]
if self.global_search_locations.lock().unwrap().is_empty() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was missing

@@ -54,51 +74,62 @@ impl Environment for EnvironmentApi {
get_env_var(key)
}
fn get_know_global_search_locations(&self) -> Vec<PathBuf> {
let mut paths = env::split_paths(&self.get_env_var("PATH".to_string()).unwrap_or_default())
.collect::<Vec<PathBuf>>();
if self.global_search_locations.lock().unwrap().is_empty() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cached this instead of computing this everytime

@DonJayamanne DonJayamanne marked this pull request as ready for review June 25, 2024 05:28
@vscodenpa vscodenpa added this to the June 2024 milestone Jun 25, 2024
@DonJayamanne DonJayamanne merged commit 786b985 into main Jun 25, 2024
24 checks passed
@DonJayamanne DonJayamanne deleted the windowsGlobalSearch branch June 25, 2024 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants