Append a source to the arena and return its index. Test-only helper that bypasses `user_source_indices` bookkeeping.
(&mut self, source: Source)
| 84 | /// Append a source to the arena and return its index. Test-only helper |
| 85 | /// that bypasses `user_source_indices` bookkeeping. |
| 86 | pub fn add_source(&mut self, source: Source) -> SourceIdx { |
| 87 | let idx = SourceIdx(self.all.len()); |
| 88 | self.all.push(source); |
| 89 | idx |
| 90 | } |
| 91 | |
| 92 | /// Iterate the package.json sources only. Pnpm yaml is excluded. |
| 93 | /// Used by `format`, `find_package`, name lookups. |