From b10d93291fb6b3a7087bff1e93b39ccbb6b4099a Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Mon, 13 Jun 2016 14:20:31 -0700 Subject: [PATCH] Absolute-ify paths in both places --- src/compiler/program.ts | 3 +- .../reference/library-reference-11.trace.json | 8 ++--- .../reference/library-reference-12.trace.json | 8 ++--- .../reference/library-reference-3.trace.json | 8 ++--- .../reference/library-reference-6.trace.json | 20 +++++------ .../reference/library-reference-7.trace.json | 8 ++--- .../reference/typingsLookup1.trace.json | 34 ++++--------------- 7 files changed, 34 insertions(+), 55 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 59ae0d862ad..28dd6275143 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -192,7 +192,8 @@ namespace ts { traceEnabled }; - const typeRoots = options.typeRoots || defaultTypeRoots; + const typeRoots = options.typeRoots || + defaultTypeRoots.map(d => combinePaths(options.configFilePath ? getDirectoryPath(options.configFilePath) : host.getCurrentDirectory(), d)); if (traceEnabled) { if (containingFile === undefined) { if (typeRoots === undefined) { diff --git a/tests/baselines/reference/library-reference-11.trace.json b/tests/baselines/reference/library-reference-11.trace.json index 7f6a32a0b23..365fe3ce72d 100644 --- a/tests/baselines/reference/library-reference-11.trace.json +++ b/tests/baselines/reference/library-reference-11.trace.json @@ -1,8 +1,8 @@ [ - "======== Resolving type reference directive 'jquery', containing file '/a/b/consumer.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.", + "======== Resolving type reference directive 'jquery', containing file '/a/b/consumer.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 '/a/b'", "File '/a/b/node_modules/jquery.ts' does not exist.", "File '/a/b/node_modules/jquery.d.ts' does not exist.", diff --git a/tests/baselines/reference/library-reference-12.trace.json b/tests/baselines/reference/library-reference-12.trace.json index b3debaec9d6..84144f82729 100644 --- a/tests/baselines/reference/library-reference-12.trace.json +++ b/tests/baselines/reference/library-reference-12.trace.json @@ -1,8 +1,8 @@ [ - "======== Resolving type reference directive 'jquery', containing file '/a/b/consumer.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.", + "======== Resolving type reference directive 'jquery', containing file '/a/b/consumer.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 '/a/b'", "File '/a/b/node_modules/jquery.ts' does not exist.", "File '/a/b/node_modules/jquery.d.ts' does not exist.", diff --git a/tests/baselines/reference/library-reference-3.trace.json b/tests/baselines/reference/library-reference-3.trace.json index 909e42140c8..730835c65e9 100644 --- a/tests/baselines/reference/library-reference-3.trace.json +++ b/tests/baselines/reference/library-reference-3.trace.json @@ -1,8 +1,8 @@ [ - "======== Resolving type reference directive 'jquery', containing file '/src/consumer.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.", + "======== Resolving type reference directive 'jquery', containing file '/src/consumer.ts', root directory '/src/node_modules/@types'. ========", + "Resolving with primary search path '/src/node_modules/@types'", + "File '/src/node_modules/@types/jquery/package.json' does not exist.", + "File '/src/node_modules/@types/jquery/index.d.ts' does not exist.", "Looking up in 'node_modules' folder, initial location '/src'", "File '/src/node_modules/jquery.ts' does not exist.", "File '/src/node_modules/jquery.d.ts' does not exist.", diff --git a/tests/baselines/reference/library-reference-6.trace.json b/tests/baselines/reference/library-reference-6.trace.json index 21843c2ecf4..48fb49e6c7f 100644 --- a/tests/baselines/reference/library-reference-6.trace.json +++ b/tests/baselines/reference/library-reference-6.trace.json @@ -1,12 +1,12 @@ [ - "======== Resolving type reference directive 'alpha', containing file '/src/foo.ts', root directory 'node_modules/@types'. ========", - "Resolving with primary search path 'node_modules/@types'", - "File 'node_modules/@types/alpha/package.json' does not exist.", - "File 'node_modules/@types/alpha/index.d.ts' exist - use it as a name resolution result.", - "======== Type reference directive 'alpha' was successfully resolved to 'node_modules/@types/alpha/index.d.ts', primary: true. ========", - "======== Resolving type reference directive 'alpha', containing file '/src/__inferred type names__.ts', root directory 'node_modules/@types'. ========", - "Resolving with primary search path 'node_modules/@types'", - "File 'node_modules/@types/alpha/package.json' does not exist.", - "File 'node_modules/@types/alpha/index.d.ts' exist - use it as a name resolution result.", - "======== Type reference directive 'alpha' was successfully resolved to 'node_modules/@types/alpha/index.d.ts', primary: true. ========" + "======== Resolving type reference directive 'alpha', containing file '/src/foo.ts', root directory '/node_modules/@types'. ========", + "Resolving with primary search path '/node_modules/@types'", + "File '/node_modules/@types/alpha/package.json' does not exist.", + "File '/node_modules/@types/alpha/index.d.ts' exist - use it as a name resolution result.", + "======== Type reference directive 'alpha' was successfully resolved to '/node_modules/@types/alpha/index.d.ts', primary: true. ========", + "======== Resolving type reference directive 'alpha', containing file '/src/__inferred type names__.ts', root directory '/node_modules/@types'. ========", + "Resolving with primary search path '/node_modules/@types'", + "File '/node_modules/@types/alpha/package.json' does not exist.", + "File '/node_modules/@types/alpha/index.d.ts' exist - use it as a name resolution result.", + "======== Type reference directive 'alpha' was successfully resolved to '/node_modules/@types/alpha/index.d.ts', primary: true. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/library-reference-7.trace.json b/tests/baselines/reference/library-reference-7.trace.json index 909e42140c8..b681ea312a8 100644 --- a/tests/baselines/reference/library-reference-7.trace.json +++ b/tests/baselines/reference/library-reference-7.trace.json @@ -1,8 +1,8 @@ [ - "======== Resolving type reference directive 'jquery', containing file '/src/consumer.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.", + "======== Resolving type reference directive 'jquery', containing file '/src/consumer.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 '/src'", "File '/src/node_modules/jquery.ts' does not exist.", "File '/src/node_modules/jquery.d.ts' does not exist.", diff --git a/tests/baselines/reference/typingsLookup1.trace.json b/tests/baselines/reference/typingsLookup1.trace.json index ad0354157c3..83b0e91d6c7 100644 --- a/tests/baselines/reference/typingsLookup1.trace.json +++ b/tests/baselines/reference/typingsLookup1.trace.json @@ -1,34 +1,12 @@ [ - "======== Resolving type reference directive 'jquery', containing file '/a.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.", + "======== Resolving type reference directive 'jquery', containing file '/a.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.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.", + "======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/index.d.ts', primary: true. ========", + "======== 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.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. ========" + "======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/index.d.ts', primary: true. ========" ] \ No newline at end of file