MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / add_vendor_dir

Method add_vendor_dir

src/server.rs:1843–1860  ·  view source on GitHub ↗

Register a vendor directory path and its URI prefix for vendor-file detection.

(&self, vendor_path: &std::path::Path)

Source from the content-addressed store, hash-verified

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

Callers 2

init_single_projectMethod · 0.80
init_monorepoMethod · 0.80

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected