* 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 )
| 1924 | * Called as a fallback after relative and aliased resolution fail. |
| 1925 | */ |
| 1926 | function resolveCppIncludePath( |
| 1927 | importPath: string, |
| 1928 | language: Language, |
| 1929 | context: ResolutionContext |
| 1930 | ): string | null { |
| 1931 | // (The search doesn't depend on the including file, and a project's files |
| 1932 | // include one header from hundreds of places.) |
| 1933 | let memo = cppIncludeSearches.get(context); |
| 1934 | if (!memo) cppIncludeSearches.set(context, (memo = new Map())); |
| 1935 | const key = `${language}\0${importPath}`; |
| 1936 | let found = memo.get(key); |
| 1937 | if (found === undefined) memo.set(key, (found = searchCppIncludeDirs(importPath, language, context))); |
| 1938 | return found; |
| 1939 | } |
| 1940 | |
| 1941 | function searchCppIncludeDirs( |
| 1942 | importPath: string, |
no test coverage detected