mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-24 20:44:53 -05:00
[Release-2.0] Fix 9662: Visual Studio 2015 with TS2.0 gives incorrect @types path resolution errors (#9867)
* Change the shape of the shim layer to support getAutomaticTypeDirectives * Change the key for looking up automatic type-directives * Update baselines from change look-up name of type-directives * Add @currentDirectory into the test * Update baselines * Fix linting error * Address PR: fix spelling mistake * Instead of return path of the type directive names just return type directive names
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
[
|
||||
"======== Resolving type reference directive 'jquery', containing file '/a/b/__inferred type names__.ts', root directory '/a/types'. ========",
|
||||
"======== Resolving type reference directive 'jquery', containing file '/__inferred type names__.ts', root directory '/a/types'. ========",
|
||||
"Resolving with primary search path '/a/types'",
|
||||
"File '/a/types/jquery/package.json' does not exist.",
|
||||
"File '/a/types/jquery/index.d.ts' exist - use it as a name resolution result.",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[
|
||||
"======== Resolving type reference directive 'jquery', containing file '/a/b/__inferred type names__.ts', root directory '/a/types'. ========",
|
||||
"======== Resolving type reference directive 'jquery', containing file '/a/__inferred type names__.ts', root directory '/a/types'. ========",
|
||||
"Resolving with primary search path '/a/types'",
|
||||
"File '/a/types/jquery/package.json' does not exist.",
|
||||
"File '/a/types/jquery/index.d.ts' exist - use it as a name resolution result.",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[
|
||||
"======== Resolving type reference directive 'jquery', containing file '/a/b/__inferred type names__.ts', root directory 'types'. ========",
|
||||
"======== Resolving type reference directive 'jquery', containing file '/a/__inferred type names__.ts', root directory 'types'. ========",
|
||||
"Resolving with primary search path 'types'",
|
||||
"File 'types/jquery/package.json' does not exist.",
|
||||
"File 'types/jquery/index.d.ts' exist - use it as a name resolution result.",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"'package.json' has 'types' field 'jquery.d.ts' that references '/types/jquery/jquery.d.ts'.",
|
||||
"File '/types/jquery/jquery.d.ts' exist - use it as a name resolution result.",
|
||||
"======== Type reference directive 'jquery' was successfully resolved to '/types/jquery/jquery.d.ts', primary: true. ========",
|
||||
"======== Resolving type reference directive 'jquery', containing file '/__inferred type names__.ts', root directory '/types'. ========",
|
||||
"======== Resolving type reference directive 'jquery', containing file 'test/__inferred type names__.ts', root directory '/types'. ========",
|
||||
"Resolving with primary search path '/types'",
|
||||
"Found 'package.json' at '/types/jquery/package.json'.",
|
||||
"'package.json' has 'types' field 'jquery.d.ts' that references '/types/jquery/jquery.d.ts'.",
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"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 type reference directive 'alpha', containing file '/__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.",
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
//// [index.d.ts]
|
||||
|
||||
|
||||
interface $ { x }
|
||||
|
||||
//// [app.ts]
|
||||
|
||||
@@ -9,8 +9,7 @@ interface A {
|
||||
}
|
||||
=== /types/lib/index.d.ts ===
|
||||
|
||||
|
||||
interface $ { x }
|
||||
>$ : Symbol($, Decl(index.d.ts, 0, 0))
|
||||
>x : Symbol($.x, Decl(index.d.ts, 2, 13))
|
||||
>x : Symbol($.x, Decl(index.d.ts, 1, 13))
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ interface A {
|
||||
}
|
||||
=== /types/lib/index.d.ts ===
|
||||
|
||||
|
||||
interface $ { x }
|
||||
>$ : $
|
||||
>x : any
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// @traceResolution: true
|
||||
// @declaration: true
|
||||
// @typeRoots: /types
|
||||
|
||||
// @currentDirectory: /
|
||||
|
||||
// @filename: /types/lib/index.d.ts
|
||||
interface $ { x }
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// @declaration: true
|
||||
// @typeRoots: /types
|
||||
// @traceResolution: true
|
||||
// @currentDirectory: /
|
||||
|
||||
// @filename: /ref.d.ts
|
||||
export interface $ { x }
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
// @traceResolution: true
|
||||
// @types: lib
|
||||
// @out: output.js
|
||||
// @currentDirectory: /
|
||||
|
||||
// @filename: /types/lib/index.d.ts
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// @typeRoots: /types
|
||||
// @traceResolution: true
|
||||
// @out: output.js
|
||||
// @currentDirectory: /
|
||||
|
||||
// @filename: /types/lib/index.d.ts
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// @declaration: true
|
||||
// @typeRoots: /types
|
||||
// @traceResolution: true
|
||||
// @currentDirectory: /
|
||||
|
||||
// @filename: /ref.d.ts
|
||||
export interface $ { x }
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// @declaration: true
|
||||
// @typeRoots: /types
|
||||
// @types: lib
|
||||
// @currentDirectory: /
|
||||
|
||||
// @filename: /types/lib/index.d.ts
|
||||
interface $ { x }
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// @declaration: true
|
||||
// @typeRoots: /types
|
||||
// @traceResolution: true
|
||||
// @currentDirectory: /
|
||||
|
||||
// $ comes from d.ts file - no need to add type reference directive
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// @traceResolution: true
|
||||
// @declaration: true
|
||||
// @typeRoots: /types
|
||||
// @currentDirectory: /
|
||||
|
||||
// $ comes from d.ts file - no need to add type reference directive
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// @traceResolution: true
|
||||
// @declaration: true
|
||||
// @typeRoots: /types
|
||||
// @currentDirectory: /
|
||||
|
||||
// @filename: /ref.d.ts
|
||||
export interface $ { x }
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// @traceResolution: true
|
||||
// @declaration: true
|
||||
// @typeRoots: /types
|
||||
// @currentDirectory: /
|
||||
|
||||
// $ comes from type declaration file - type reference directive should be added
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// @traceResolution: true
|
||||
// @declaration: true
|
||||
// @typeRoots: /types
|
||||
// @currentDirectory: /
|
||||
|
||||
// local value shadows global - no need to add type reference directive
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// @typeRoots: /types
|
||||
// @traceResolution: true
|
||||
// @types: lib
|
||||
// @currentDirectory: /
|
||||
|
||||
// @filename: /types/lib/index.d.ts
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// @declaration: true
|
||||
// @typeRoots: /types
|
||||
// @traceResolution: true
|
||||
// @currentDirectory: /
|
||||
|
||||
// @filename: /types/lib/index.d.ts
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// @noImplicitReferences: true
|
||||
// @traceResolution: true
|
||||
// @currentDirectory: /
|
||||
|
||||
// load type declarations from types section of tsconfig
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// @traceResolution: true
|
||||
// @noImplicitReferences: true
|
||||
// @currentDirectory: /
|
||||
|
||||
// @filename: /tsconfig.json
|
||||
{ "files": "a.ts" }
|
||||
|
||||
Reference in New Issue
Block a user