MCPcopy Create free account
hub / github.com/angular/angular / set_root_dirs

Method set_root_dirs

packages/compiler-cli/preprocessor/ng-analyze/src/fs.rs:192–203  ·  view source on GitHub ↗
(&self, root_dirs: Vec<PathBuf>)

Source from the content-addressed store, hash-verified

190 }
191
192 pub fn set_root_dirs(&self, root_dirs: Vec<PathBuf>) {
193 let mut dirs = self.root_dirs.write().unwrap();
194 let mut normalized: Vec<PathBuf> = root_dirs
195 .into_iter()
196 .map(|p| normalize_path(&p).into_owned())
197 .collect();
198 // Sort by path length in descending order (longest first) for robust prefix matching.
199 // https://github.com/angular/angular/blob/b53fa3c/packages/compiler-cli/src/ngtsc/file_system/src/logical.ts#L70
200 normalized.sort_by_key(|p| std::cmp::Reverse(p.as_os_str().len()));
201 *dirs = normalized;
202 self.is_allowed_cache.write().unwrap().clear();
203 }
204
205 pub fn set_preserve_symlinks(&self, value: bool) {
206 self.preserve_symlinks.store(value, Ordering::Relaxed);

Calls 6

normalize_pathFunction · 0.85
mapMethod · 0.80
unwrapMethod · 0.65
writeMethod · 0.65
lenMethod · 0.45
clearMethod · 0.45