From e4844b281d52a181802bb800f19d74853469766a Mon Sep 17 00:00:00 2001 From: hrou0003 <54772688+hrou0003@users.noreply.github.com> Date: Sat, 12 Apr 2025 22:54:47 +1000 Subject: [PATCH] Keep .vscode folder included during initialization even if it's in .gitignore (#28631) This fixes an issue where tasks in `.vscode/tasks.json` weren't being loaded at startup of a project Closes #28494 Release Notes: - Tasks are now loaded from local `.vscode/tasks.json` files even if they are `.gitignore`d --- crates/paths/src/paths.rs | 5 +++++ crates/worktree/src/worktree.rs | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/paths/src/paths.rs b/crates/paths/src/paths.rs index 622e4a67f3..9f7644ee9b 100644 --- a/crates/paths/src/paths.rs +++ b/crates/paths/src/paths.rs @@ -375,6 +375,11 @@ pub fn local_settings_folder_relative_path() -> &'static Path { Path::new(".zed") } +/// Returns the relative path to a `.vscode` folder within a project. +pub fn local_vscode_folder_relative_path() -> &'static Path { + Path::new(".vscode") +} + /// Returns the relative path to a `settings.json` file within a project. pub fn local_settings_file_relative_path() -> &'static Path { Path::new(".zed/settings.json") diff --git a/crates/worktree/src/worktree.rs b/crates/worktree/src/worktree.rs index eff02a5cfa..fa4bf202d8 100644 --- a/crates/worktree/src/worktree.rs +++ b/crates/worktree/src/worktree.rs @@ -29,7 +29,7 @@ use ignore::IgnoreStack; use language::DiskState; use parking_lot::Mutex; -use paths::local_settings_folder_relative_path; +use paths::{local_settings_folder_relative_path, local_vscode_folder_relative_path}; use postage::{ barrier, prelude::{Sink as _, Stream as _}, @@ -2865,6 +2865,7 @@ impl BackgroundScannerState { (!entry.is_external && (!entry.is_ignored || entry.is_always_included)) || entry.path.file_name() == Some(*DOT_GIT) || entry.path.file_name() == Some(local_settings_folder_relative_path().as_os_str()) + || entry.path.file_name() == Some(local_vscode_folder_relative_path().as_os_str()) || self.scanned_dirs.contains(&entry.id) // If we've ever scanned it, keep scanning || self .paths_to_scan