( uris: string[], ide: IDE, )
| 292 | } |
| 293 | |
| 294 | export async function getSymbolsForManyFiles( |
| 295 | uris: string[], |
| 296 | ide: IDE, |
| 297 | ): Promise<FileSymbolMap> { |
| 298 | const filesAndSymbols = await Promise.all( |
| 299 | uris.map(async (uri): Promise<[string, SymbolWithRange[]]> => { |
| 300 | const contents = await ide.readFile(uri); |
| 301 | let symbols = undefined; |
| 302 | try { |
| 303 | symbols = await getSymbolsForFile(uri, contents); |
| 304 | } catch (e) { |
| 305 | console.error(`Failed to get symbols for ${uri}:`, e); |
| 306 | } |
| 307 | return [uri, symbols ?? []]; |
| 308 | }), |
| 309 | ); |
| 310 | return Object.fromEntries(filesAndSymbols); |
| 311 | } |
no test coverage detected