CR changes

This commit is contained in:
Ryan Cavanaugh 2016-06-13 10:15:29 -07:00
parent e8ac1abbd6
commit 6702e651a3
3 changed files with 19 additions and 4 deletions

View file

@ -1031,7 +1031,9 @@ namespace ts {
// Walk the primary type lookup locations
let result: string[] = [];
if (host.directoryExists && host.getDirectories) {
for (const root of options.typeRoots || defaultTypeRoots) {
const typeRoots = options.typeRoots ||
defaultTypeRoots.map(d => combinePaths(options.configFilePath ? getDirectoryPath(options.configFilePath) : host.getCurrentDirectory(), d));
for (const root of typeRoots) {
if (host.directoryExists(root)) {
result = result.concat(host.getDirectories(root));
}

View file

@ -14,5 +14,21 @@
"File '/node_modules/@types/jquery/package.json' does not exist.",
"File '/node_modules/@types/jquery/index.ts' does not exist.",
"File '/node_modules/@types/jquery/index.d.ts' exist - use it as a name resolution result.",
"======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/index.d.ts', primary: false. ========",
"======== Resolving type reference directive 'jquery', containing file '/__inferred type names__.ts', root directory 'node_modules/@types'. ========",
"Resolving with primary search path 'node_modules/@types'",
"File 'node_modules/@types/jquery/package.json' does not exist.",
"File 'node_modules/@types/jquery/index.d.ts' does not exist.",
"Looking up in 'node_modules' folder, initial location '/'",
"File '/node_modules/jquery.ts' does not exist.",
"File '/node_modules/jquery.d.ts' does not exist.",
"File '/node_modules/jquery/package.json' does not exist.",
"File '/node_modules/jquery/index.ts' does not exist.",
"File '/node_modules/jquery/index.d.ts' does not exist.",
"File '/node_modules/@types/jquery.ts' does not exist.",
"File '/node_modules/@types/jquery.d.ts' does not exist.",
"File '/node_modules/@types/jquery/package.json' does not exist.",
"File '/node_modules/@types/jquery/index.ts' does not exist.",
"File '/node_modules/@types/jquery/index.d.ts' exist - use it as a name resolution result.",
"======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/index.d.ts', primary: false. ========"
]

View file

@ -13,7 +13,4 @@ var x: string = alpha.a;
// @filename: /tsconfig.json
{
"compilerOptions": {
"typesRoot": "types"
}
}