* 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 )
| 1863 | * Called as a fallback after relative and aliased resolution fail. |
| 1864 | */ |
| 1865 | function resolveCppIncludePath( |
| 1866 | importPath: string, |
| 1867 | language: Language, |
| 1868 | context: ResolutionContext |
| 1869 | ): string | null { |
| 1870 | // (The search doesn't depend on the including file, and a project's files |
| 1871 | // include one header from hundreds of places.) |
| 1872 | let memo = cppIncludeSearches.get(context); |
| 1873 | if (!memo) cppIncludeSearches.set(context, (memo = new Map())); |
| 1874 | const key = `${language}\0${importPath}`; |
| 1875 | let found = memo.get(key); |
| 1876 | if (found === undefined) memo.set(key, (found = searchCppIncludeDirs(importPath, language, context))); |
| 1877 | return found; |
| 1878 | } |
| 1879 | |
| 1880 | function searchCppIncludeDirs( |
| 1881 | importPath: string, |
no test coverage detected