Register a vendor directory path and its URI prefix for vendor-file detection.
(&self, vendor_path: &std::path::Path)
| 1841 | /// Register a vendor directory path and its URI prefix for |
| 1842 | /// vendor-file detection. |
| 1843 | pub(crate) fn add_vendor_dir(&self, vendor_path: &std::path::Path) { |
| 1844 | // Store the absolute path for filesystem-level skip logic. |
| 1845 | { |
| 1846 | let mut paths = self.vendor_dir_paths.lock(); |
| 1847 | paths.push(vendor_path.to_path_buf()); |
| 1848 | } |
| 1849 | // Store the URI prefix for URI-level skip logic (diagnostics, |
| 1850 | // find references, rename). |
| 1851 | let prefix = if let Ok(canonical) = vendor_path.canonicalize() { |
| 1852 | format!("{}/", crate::util::path_to_uri(&canonical)) |
| 1853 | } else { |
| 1854 | format!("{}/", crate::util::path_to_uri(vendor_path)) |
| 1855 | }; |
| 1856 | { |
| 1857 | let mut prefixes = self.vendor_uri_prefixes.lock(); |
| 1858 | prefixes.push(prefix); |
| 1859 | } |
| 1860 | } |
| 1861 | |
| 1862 | /// Scan autoload files for a single project root and populate the |
| 1863 | /// autoload indices. Returns the number of autoload file entries |
no test coverage detected