2018-05-11 00:31:06 +02:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
// @Filename: /a.ts
|
2019-06-13 21:25:02 +02:00
|
|
|
////[|type [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}T|] = number;|]
|
|
|
|
////[|namespace [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}T|] {
|
2018-05-11 00:31:06 +02:00
|
|
|
//// export type U = string;
|
2019-06-04 22:58:27 +02:00
|
|
|
////}|]
|
2019-06-13 21:25:02 +02:00
|
|
|
////[|[|{| "contextRangeIndex": 4 |}export|] = [|{| "contextRangeIndex": 4 |}T|];|]
|
2018-05-11 00:31:06 +02:00
|
|
|
|
|
|
|
// @Filename: /b.ts
|
2019-06-13 21:25:02 +02:00
|
|
|
////[|const x: import("[|{| "contextRangeIndex": 7 |}./[|a|]|]") = 0;|]
|
|
|
|
////[|const y: import("[|{| "contextRangeIndex": 10 |}./[|a|]|]").U = "";|]
|
2018-05-11 00:31:06 +02:00
|
|
|
|
|
|
|
verify.noErrors();
|
|
|
|
|
2019-06-06 21:51:26 +02:00
|
|
|
const [r0Def, r0, r1Def, r1, r2Def, rExport, r2, r3Def, r3, r3b, r4Def, r4, r4b] = test.ranges();
|
2018-05-11 00:31:06 +02:00
|
|
|
verify.referenceGroups(r0, [{ definition: "type T = number\nnamespace T", ranges: [r0, r2, r3] }]);
|
2018-09-07 21:23:23 +02:00
|
|
|
verify.referenceGroups(r1, [{ definition: "namespace T", ranges: [r1, r2] }]);
|
2018-11-09 18:38:45 +01:00
|
|
|
const t: FourSlashInterface.ReferenceGroup = { definition: "type T = number\nnamespace T", ranges: [r0, r1, r2, r3] };
|
|
|
|
verify.referenceGroups(r2, [t]);
|
|
|
|
verify.referenceGroups([r3, r4], [{ definition: 'module "/a"', ranges: [r4, rExport] }, t]);
|
2020-01-31 20:53:57 +01:00
|
|
|
verify.referenceGroups(rExport, [t]);
|
2018-05-11 00:31:06 +02:00
|
|
|
|
|
|
|
verify.renameLocations(r0, [r0, r2]);
|
|
|
|
verify.renameLocations(r1, [r1, r2]);
|
|
|
|
verify.renameLocations(r2, [r0, r1, r2]);
|
2018-09-18 00:26:41 +02:00
|
|
|
for (const range of [r3b, r4b]) {
|
2018-05-11 00:31:06 +02:00
|
|
|
goTo.rangeStart(range);
|
2018-09-10 20:25:03 +02:00
|
|
|
verify.renameInfoSucceeded(/*displayName*/ "/a.ts", /*fullDisplayName*/ "/a.ts", /*kind*/ "module", /*kindModifiers*/ "", /*fileToRename*/ "/a.ts", range);
|
2019-01-11 23:45:08 +01:00
|
|
|
verify.renameInfoFailed("You cannot rename this element.", /*allowRenameOfImportPath*/ false);
|
2018-05-11 00:31:06 +02:00
|
|
|
}
|