forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go-to-type-definition, and find-all-refs should work for import.meta (m…
…icrosoft#44364) * go-to-type-definition, and find-all-refs should work for import.meta * search `meta` instead of `import.meta` * remove `definition` * fix compilation error * update baseline * revert definition
- Loading branch information
Showing
9 changed files
with
199 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
tests/baselines/reference/findAllRefsImportMeta.baseline.jsonc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// === /tests/cases/fourslash/foo.ts === | ||
// /// <reference no-default-lib="true"/> | ||
// /// <reference path='./bar.d.ts' /> | ||
// import./*FIND ALL REFS*/[|meta|]; | ||
// import.[|meta|]; | ||
|
||
// === /tests/cases/fourslash/baz.ts === | ||
// /// <reference no-default-lib="true"/> | ||
// /// <reference path='./bar.d.ts' /> | ||
// let x = import | ||
// . // hai :) | ||
// [|meta|]; | ||
|
||
[ | ||
{ | ||
"definition": { | ||
"containerKind": "", | ||
"containerName": "", | ||
"fileName": "/tests/cases/fourslash/foo.ts", | ||
"kind": "keyword", | ||
"textSpan": { | ||
"start": 82, | ||
"length": 4 | ||
}, | ||
"displayParts": [ | ||
{ | ||
"kind": "keyword" | ||
} | ||
] | ||
}, | ||
"references": [ | ||
{ | ||
"textSpan": { | ||
"start": 82, | ||
"length": 4 | ||
}, | ||
"fileName": "/tests/cases/fourslash/foo.ts", | ||
"isWriteAccess": false, | ||
"isDefinition": false | ||
}, | ||
{ | ||
"textSpan": { | ||
"start": 95, | ||
"length": 4 | ||
}, | ||
"fileName": "/tests/cases/fourslash/foo.ts", | ||
"isWriteAccess": false, | ||
"isDefinition": false | ||
}, | ||
{ | ||
"textSpan": { | ||
"start": 109, | ||
"length": 4 | ||
}, | ||
"fileName": "/tests/cases/fourslash/baz.ts", | ||
"isWriteAccess": false, | ||
"isDefinition": false | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[ | ||
{ | ||
"marker": { | ||
"fileName": "/tests/cases/fourslash/foo.ts", | ||
"position": 77, | ||
"name": "1" | ||
}, | ||
"quickInfo": { | ||
"kind": "", | ||
"kindModifiers": "", | ||
"textSpan": { | ||
"start": 75, | ||
"length": 6 | ||
}, | ||
"displayParts": [], | ||
"documentation": [] | ||
} | ||
}, | ||
{ | ||
"marker": { | ||
"fileName": "/tests/cases/fourslash/foo.ts", | ||
"position": 84, | ||
"name": "2" | ||
}, | ||
"quickInfo": { | ||
"kind": "interface", | ||
"kindModifiers": "declare", | ||
"textSpan": { | ||
"start": 75, | ||
"length": 11 | ||
}, | ||
"displayParts": [], | ||
"documentation": [ | ||
{ | ||
"text": "The type of `import.meta`.\n\nIf you need to declare that a given property exists on `import.meta`,\nthis type may be augmented via interface merging.", | ||
"kind": "text" | ||
} | ||
] | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// @noLib: true | ||
|
||
/// <reference path='fourslash.ts'/> | ||
|
||
// @module: esnext | ||
// @Filename: foo.ts | ||
/////// <reference no-default-lib="true"/> | ||
/////// <reference path='./bar.d.ts' /> | ||
////import./**/meta; | ||
////import.[|meta|]; | ||
|
||
//@Filename: bar.d.ts | ||
////interface ImportMeta { | ||
////} | ||
|
||
// @Filename: baz.ts | ||
/////// <reference no-default-lib="true"/> | ||
/////// <reference path='./bar.d.ts' /> | ||
////let x = import | ||
//// . // hai :) | ||
//// meta; | ||
|
||
verify.baselineFindAllReferences(""); | ||
|
||
goTo.rangeStart(test.ranges()[0]); | ||
verify.renameInfoFailed(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
// @module: esnext | ||
// @Filename: foo.ts | ||
/////// <reference no-default-lib="true"/> | ||
/////// <reference path='./bar.d.ts' /> | ||
////import.me/*reference*/ta; | ||
|
||
//@Filename: bar.d.ts | ||
////interface ImportMeta { | ||
////} | ||
|
||
verify.goToDefinition("reference", []); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
// @module: esnext | ||
// @Filename: foo.ts | ||
/////// <reference no-default-lib="true"/> | ||
/////// <reference path='./bar.d.ts' /> | ||
////import.me/*reference*/ta; | ||
|
||
//@Filename: bar.d.ts | ||
////interface /*definition*/ImportMeta { | ||
////} | ||
|
||
verify.goToType("reference", "definition"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
///<reference path="fourslash.ts" /> | ||
|
||
// @module: esnext | ||
// @Filename: foo.ts | ||
/////// <reference no-default-lib="true"/> | ||
/////// <reference path='./bar.d.ts' /> | ||
////im/*1*/port.me/*2*/ta; | ||
|
||
//@Filename: bar.d.ts | ||
/////** | ||
//// * The type of `import.meta`. | ||
//// * | ||
//// * If you need to declare that a given property exists on `import.meta`, | ||
//// * this type may be augmented via interface merging. | ||
//// */ | ||
//// interface ImportMeta { | ||
////} | ||
|
||
verify.baselineQuickInfo() |