* Resolve a C/C++ include path by searching include directories. * Called as a fallback after relative and aliased resolution fail.
( importPath: string, language: Language, context: ResolutionContext )
| 2172 | * Called as a fallback after relative and aliased resolution fail. |
| 2173 | */ |
| 2174 | function resolveCppIncludePath( |
| 2175 | importPath: string, |
| 2176 | language: Language, |
| 2177 | context: ResolutionContext |
| 2178 | ): string | null { |
| 2179 | // (The search doesn't depend on the including file, and a project's files |
| 2180 | // include one header from hundreds of places.) |
| 2181 | let memo = cppIncludeSearches.get(context); |
| 2182 | if (!memo) cppIncludeSearches.set(context, (memo = new Map())); |
| 2183 | const key = `${language}\0${importPath}`; |
| 2184 | let found = memo.get(key); |
| 2185 | if (found === undefined) memo.set(key, (found = searchCppIncludeDirs(importPath, language, context))); |
| 2186 | return found; |
| 2187 | } |
| 2188 | |
| 2189 | function searchCppIncludeDirs( |
| 2190 | importPath: string, |
no test coverage detected