More tests
This commit is contained in:
parent
004488c0c9
commit
35c049949f
|
@ -1,9 +1,9 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: a.ts
|
||||
////function [|{| "isWriteAccess": true, "isDefinition": true |}decorator|](target) {
|
||||
////[|function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}decorator|](target) {
|
||||
//// return target;
|
||||
////}
|
||||
////}|]
|
||||
////[|decorator|]();
|
||||
|
||||
// @Filename: b.ts
|
||||
|
@ -13,4 +13,4 @@
|
|||
//// method() {}
|
||||
////}
|
||||
|
||||
verify.singleReferenceGroup("function decorator(target: any): any");
|
||||
verify.singleReferenceGroup("function decorator(target: any): any", test.rangesByText().get("decorator"));
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
////
|
||||
//// }
|
||||
////
|
||||
//// public [|{| "isWriteAccess": true, "isDefinition": true |}start|](){
|
||||
//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}start|](){
|
||||
//// return this;
|
||||
//// }
|
||||
//// }|]
|
||||
////
|
||||
//// public stop(){
|
||||
//// return this;
|
||||
|
@ -23,4 +23,4 @@
|
|||
////second.[|start|]();
|
||||
////second.stop();
|
||||
|
||||
verify.singleReferenceGroup("(method) Test.start(): this");
|
||||
verify.singleReferenceGroup("(method) Test.start(): this", test.rangesByText().get("start"));
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
//@Filename: findAllRefsOnDefinition2-import.ts
|
||||
////export module Test{
|
||||
////
|
||||
//// export interface [|{| "isWriteAccess": true, "isDefinition": true |}start|] { }
|
||||
//// [|export interface [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}start|] { }|]
|
||||
////
|
||||
//// export interface stop { }
|
||||
////}
|
||||
|
@ -14,4 +14,4 @@
|
|||
////var start: Second.Test.[|start|];
|
||||
////var stop: Second.Test.stop;
|
||||
|
||||
verify.singleReferenceGroup("interface Test.start");
|
||||
verify.singleReferenceGroup("interface Test.start", test.rangesByText().get("start"));
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
//@Filename: a.ts
|
||||
////export class [|{| "isWriteAccess": true, "isDefinition": true |}Class|] {
|
||||
////}
|
||||
////[|export class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}Class|] {
|
||||
////}|]
|
||||
|
||||
//@Filename: b.ts
|
||||
////import { [|{| "isWriteAccess": true, "isDefinition": true |}Class|] } from "./a";
|
||||
////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}Class|] } from "./a";|]
|
||||
////
|
||||
////var c = new [|Class|]();
|
||||
|
||||
//@Filename: c.ts
|
||||
////export { [|{| "isWriteAccess": true, "isDefinition": true |}Class|] } from "./a";
|
||||
////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 5 |}Class|] } from "./a";|]
|
||||
|
||||
const ranges = test.ranges();
|
||||
const [r0, r1, r2, r3] = ranges;
|
||||
const [r0Def, r0, r1Def, r1, r2, r3Def, r3] = ranges;
|
||||
const classes = { definition: "class Class", ranges: [r0] };
|
||||
const imports = { definition: "(alias) class Class\nimport Class", ranges: [r1, r2] };
|
||||
const reExports = { definition: "(alias) class Class\nexport Class", ranges: [r3] };
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////class ABCD {
|
||||
//// constructor(private x: number, public y: number, private [|{| "isWriteAccess": true, "isDefinition": true |}z|]: number) {
|
||||
//// constructor(private x: number, public y: number, [|private [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}z|]: number|]) {
|
||||
//// }
|
||||
////
|
||||
//// func() {
|
||||
|
@ -9,4 +9,4 @@
|
|||
//// }
|
||||
////}
|
||||
|
||||
verify.singleReferenceGroup("(property) ABCD.z: number");
|
||||
verify.singleReferenceGroup("(property) ABCD.z: number", test.rangesByText().get("z"));
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// class Foo {
|
||||
//// constructor(private [|{| "isWriteAccess": true, "isDefinition": true |}privateParam|]: number) {
|
||||
//// constructor([|private [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}privateParam|]: number|]) {
|
||||
//// let localPrivate = [|privateParam|];
|
||||
//// this.[|{| "isWriteAccess": true |}privateParam|] += 10;
|
||||
//// }
|
||||
//// }
|
||||
|
||||
const ranges = test.ranges();
|
||||
const [rDef, ...ranges] = test.ranges();
|
||||
const [r0, r1, r2] = ranges;
|
||||
verify.referenceGroups(ranges, [
|
||||
{ definition: "(property) Foo.privateParam: number", ranges: [r0, r2] },
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// class Foo {
|
||||
//// constructor(public [|{| "isWriteAccess": true, "isDefinition": true |}publicParam|]: number) {
|
||||
//// constructor([|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}publicParam|]: number|]) {
|
||||
//// let localPublic = [|publicParam|];
|
||||
//// this.[|{| "isWriteAccess": true |}publicParam|] += 10;
|
||||
//// }
|
||||
//// }
|
||||
|
||||
const ranges = test.ranges();
|
||||
const [rDef, ...ranges] = test.ranges();
|
||||
const [r0, r1, r2] = ranges;
|
||||
verify.referenceGroups(ranges, [
|
||||
{ definition: "(property) Foo.publicParam: number", ranges: [r0, r2] },
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// class Foo {
|
||||
//// constructor(protected [|{| "isWriteAccess": true, "isDefinition": true |}protectedParam|]: number) {
|
||||
//// constructor([|protected [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}protectedParam|]: number|]) {
|
||||
//// let localProtected = [|protectedParam|];
|
||||
//// this.[|{| "isWriteAccess": true |}protectedParam|] += 10;
|
||||
//// }
|
||||
//// }
|
||||
|
||||
const ranges = test.ranges();
|
||||
const [rDef, ...ranges] = test.ranges();
|
||||
const [r0, r1, r2] = ranges;
|
||||
verify.referenceGroups(ranges, [
|
||||
{ definition: "(property) Foo.protectedParam: number", ranges: [r0, r2] },
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////class C {
|
||||
//// constructor(public [|{| "isWriteAccess": true, "isDefinition": true |}x|]: string) {
|
||||
//// constructor([|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|]: string|]) {
|
||||
//// [|x|];
|
||||
//// }
|
||||
////}
|
||||
////class D extends C {
|
||||
//// constructor(public [|{| "isWriteAccess": true, "isDefinition": true |}x|]: string) {
|
||||
//// constructor([|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 3 |}x|]: string|]) {
|
||||
//// super([|x|]);
|
||||
//// }
|
||||
////}
|
||||
|
||||
const [r0, r1, r2, r3] = test.ranges();
|
||||
const [r0Def, r0, r1, r2Def, r2, r3] = test.ranges();
|
||||
verify.referenceGroups(r0, [
|
||||
{ definition: "(property) C.x: string", ranges: [r0] },
|
||||
{ definition: "(parameter) x: string", ranges: [r1] },
|
||||
|
|
|
@ -2,22 +2,22 @@
|
|||
|
||||
// @Filename: /file1.ts
|
||||
////declare function log(s: string | number): void;
|
||||
////const [|{| "isWriteAccess": true, "isDefinition": true |}q|] = 1;
|
||||
////export { [|{| "isWriteAccess": true, "isDefinition": true |}q|] };
|
||||
////[|const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}q|] = 1;|]
|
||||
////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}q|] };|]
|
||||
////const x = {
|
||||
//// [|{| "isWriteAccess": true, "isDefinition": true |}z|]: 'value'
|
||||
//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}z|]: 'value'|]
|
||||
////}
|
||||
////const { [|{| "isWriteAccess": true, "isDefinition": true |}z|] } = x;
|
||||
////[|const { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}z|] } = x;|]
|
||||
////log([|z|]);
|
||||
|
||||
// @Filename: /file2.ts
|
||||
////declare function log(s: string | number): void;
|
||||
////import { [|{| "isWriteAccess": true, "isDefinition": true |}q|] } from "./file1";
|
||||
////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 9 |}q|] } from "./file1";|]
|
||||
////log([|q|] + 1);
|
||||
|
||||
verify.noErrors();
|
||||
|
||||
const [q0, q1, z0, z1, z2, q2, q3] = test.ranges();
|
||||
const [q0Def, q0, q1Def, q1, z0Def, z0, z1Def, z1, z2, q2Def, q2, q3] = test.ranges();
|
||||
const qFile1Ranges = [q0, q1];
|
||||
const qFile2Ranges = [q2, q3];
|
||||
const qFile1ReferenceGroup: FourSlashInterface.ReferenceGroup = {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/// <reference path="./fourslash.ts" />
|
||||
|
||||
////interface IFoo {
|
||||
//// [|{| "isDefinition": true |}a|]: string;
|
||||
//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}a|]: string;|]
|
||||
////}
|
||||
////class C<T extends IFoo> {
|
||||
//// method() {
|
||||
//// var x: T = {
|
||||
//// [|{| "isWriteAccess": true, "isDefinition": true |}a|]: ""
|
||||
//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}a|]: ""|]
|
||||
//// };
|
||||
//// x.[|a|];
|
||||
//// }
|
||||
|
@ -14,7 +14,7 @@
|
|||
////
|
||||
////
|
||||
////var x: IFoo = {
|
||||
//// [|{| "isWriteAccess": true, "isDefinition": true |}a|]: "ss"
|
||||
//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 5 |}a|]: "ss"|]
|
||||
////};
|
||||
|
||||
verify.singleReferenceGroup("(property) IFoo.a: string");
|
||||
verify.singleReferenceGroup("(property) IFoo.a: string", test.rangesByText().get("a"));
|
||||
|
|
|
@ -3,17 +3,17 @@
|
|||
// @noLib: true
|
||||
|
||||
// @Filename: /a.ts
|
||||
////var [|{| "isDefinition": true |}x|];
|
||||
////export { [|{| "isWriteAccess": true, "isDefinition": true |}x|] };
|
||||
////export { [|x|] as [|{| "isWriteAccess": true, "isDefinition": true |}y|] };
|
||||
////[|var [|{| "isDefinition": true, "declarationRangeIndex": 0 |}x|];|]
|
||||
////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}x|] };|]
|
||||
////[|export { [|{| "declarationRangeIndex": 4 |}x|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}y|] };|]
|
||||
|
||||
// @Filename: /b.ts
|
||||
////import { [|{| "isWriteAccess": true, "isDefinition": true |}x|], [|{| "isWriteAccess": true, "isDefinition": true |}y|] } from "./a";
|
||||
////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 7 |}x|], [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 7 |}y|] } from "./a";|]
|
||||
////[|x|]; [|y|];
|
||||
|
||||
verify.noErrors();
|
||||
|
||||
const [ax0, ax1, ax2, ay, bx0, by0, bx1, by1] = test.ranges();
|
||||
const [ax0Def, ax0, ax1Def, ax1, ax2Def, ax2, ay, bx0Def, bx0, by0, bx1, by1] = test.ranges();
|
||||
const axRanges = [ax0, ax1, ax2];
|
||||
const bxRanges = [bx0, bx1];
|
||||
const byRanges = [by0, by1];
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: /a.ts
|
||||
////export const [|{| "isWriteAccess": true, "isDefinition": true |}x|] = 0;
|
||||
////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] = 0;|]
|
||||
|
||||
// @Filename: /b.ts
|
||||
////export const [|{| "isWriteAccess": true, "isDefinition": true |}x|] = 0;
|
||||
////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}x|] = 0;|]
|
||||
|
||||
//@Filename: /c.ts
|
||||
////export { [|{| "isWriteAccess": true, "isDefinition": true |}x|] } from "./b";
|
||||
////import { [|{| "isWriteAccess": true, "isDefinition": true |}x|] } from "./a";
|
||||
////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}x|] } from "./b";|]
|
||||
////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}x|] } from "./a";|]
|
||||
////[|x|];
|
||||
|
||||
// @Filename: /d.ts
|
||||
////import { [|{| "isWriteAccess": true, "isDefinition": true |}x|] } from "./c";
|
||||
////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 9 |}x|] } from "./c";|]
|
||||
|
||||
verify.noErrors();
|
||||
const [a, b, cFromB, cFromA, cUse, d] = test.ranges();
|
||||
const [aDef, a, bDef, b, cFromBDef, cFromB, cFromADef, cFromA, cUse, dDef, d] = test.ranges();
|
||||
const cFromARanges = [cFromA, cUse];
|
||||
|
||||
const aGroup = { definition: "const x: 0", ranges: [a] };
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: /a.ts
|
||||
////export function [|{| "isWriteAccess": true, "isDefinition": true |}foo|](): void {}
|
||||
////[|export function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}foo|](): void {}|]
|
||||
|
||||
// @Filename: /b.ts
|
||||
////export * from "./a";
|
||||
|
||||
// @Filename: /c.ts
|
||||
////import { [|{| "isWriteAccess": true, "isDefinition": true |}foo|] } from "./b";
|
||||
////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}foo|] } from "./b";|]
|
||||
|
||||
verify.noErrors();
|
||||
const ranges = test.ranges();
|
||||
const [r0, r1] = ranges;
|
||||
const [r0Def, r0, r1Def, r1] = ranges;
|
||||
const a = { definition: "function foo(): void", ranges: [r0] };
|
||||
const c = { definition: "(alias) function foo(): void\nimport foo", ranges: [r1] };
|
||||
verify.referenceGroups(r0, [a, c]);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @Filename: /a.ts
|
||||
////export { [|{| "isWriteAccess": true, "isDefinition": true |}x|] };
|
||||
////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] };|]
|
||||
|
||||
verify.singleReferenceGroup("export x");
|
||||
verify.singleReferenceGroup("export x", test.rangesByText().get("x"));
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @Filename: /a.ts
|
||||
////export { [|{| "isWriteAccess": true, "isDefinition": true |}x|] } from "nonsense";
|
||||
////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] } from "nonsense";|]
|
||||
|
||||
verify.singleReferenceGroup("export x");
|
||||
verify.singleReferenceGroup("export x", test.rangesByText().get("x"));
|
||||
|
|
|
@ -1,26 +1,36 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: /a.ts
|
||||
////export function [|{| "isWriteAccess": true, "isDefinition": true |}foo|](): void {}
|
||||
////[|export function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}foo|](): void {}|]
|
||||
|
||||
// @Filename: /b.ts
|
||||
////export { [|foo|] as [|{| "isWriteAccess": true, "isDefinition": true |}bar|] } from "./a";
|
||||
////[|export { [|{| "declarationRangeIndex": 2 |}foo|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}bar|] } from "./a";|]
|
||||
|
||||
// @Filename: /c.ts
|
||||
////export { [|foo|] as [|{| "isWriteAccess": true, "isDefinition": true |}default|] } from "./a";
|
||||
////[|export { [|{| "declarationRangeIndex": 5 |}foo|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 5 |}default|] } from "./a";|]
|
||||
|
||||
// @Filename: /d.ts
|
||||
////export { [|{| "isWriteAccess": true, "isDefinition": true |}default|] } from "./c";
|
||||
////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 8 |}default|] } from "./c";|]
|
||||
|
||||
// @Filename: /e.ts
|
||||
////import { [|{| "isWriteAccess": true, "isDefinition": true |}bar|] } from "./b";
|
||||
////import [|{| "isWriteAccess": true, "isDefinition": true |}baz|] from "./c";
|
||||
////import { [|default|] as [|{| "isWriteAccess": true, "isDefinition": true |}bang|] } from "./c";
|
||||
////import [|{| "isWriteAccess": true, "isDefinition": true |}boom|] from "./d";
|
||||
////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 10 |}bar|] } from "./b";|]
|
||||
////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 12 |}baz|] from "./c";|]
|
||||
////[|import { [|{| "declarationRangeIndex": 14 |}default|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 14 |}bang|] } from "./c";|]
|
||||
////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 17 |}boom|] from "./d";|]
|
||||
////[|bar|](); [|baz|](); [|bang|](); [|boom|]();
|
||||
|
||||
verify.noErrors();
|
||||
const [foo0, foo1, bar0, foo2, defaultC, defaultD, bar1, baz0, defaultE, bang0, boom0, bar2, baz1, bang1, boom1] = test.ranges();
|
||||
const [
|
||||
foo0Def, foo0,
|
||||
foo1Def, foo1, bar0,
|
||||
foo2Def, foo2, defaultC,
|
||||
defaultDDef, defaultD,
|
||||
bar1Def, bar1,
|
||||
baz0Def, baz0,
|
||||
defaultEDef, defaultE, bang0,
|
||||
boom0Def, boom0,
|
||||
bar2, baz1, bang1, boom1
|
||||
] = test.ranges();
|
||||
const a = { definition: "function foo(): void", ranges: [foo0, foo1, foo2] };
|
||||
const b = { definition: "(alias) function bar(): void\nexport bar", ranges: [bar0] };
|
||||
const c = { definition: "(alias) function foo(): void\nexport default", ranges: [defaultC, defaultE] };
|
||||
|
@ -43,6 +53,7 @@ verify.referenceGroups([bang0, bang1], [eBang]);
|
|||
verify.referenceGroups([boom0, boom1], [eBoom, d, a, b, eBar, c, eBaz, eBang]);
|
||||
|
||||
test.rangesByText().forEach((ranges, text) => {
|
||||
if (text.indexOf("export") === 0 || text.indexOf("import") === 0) return;
|
||||
switch (text) {
|
||||
case "default":
|
||||
for (const range of ranges) {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: /a.ts
|
||||
////export function [|{| "isWriteAccess": true, "isDefinition": true |}foo|](): void {}
|
||||
////[|export function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}foo|](): void {}|]
|
||||
|
||||
// @Filename: /b.ts
|
||||
////import { [|foo|] as [|{| "isWriteAccess": true, "isDefinition": true |}oof|] } from "./a";
|
||||
////[|import { [|{| "declarationRangeIndex": 2 |}foo|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}oof|] } from "./a";|]
|
||||
|
||||
verify.noErrors();
|
||||
const [r0, r1, r2] = test.ranges();
|
||||
const [r0Def, r0, r1Def, r1, r2] = test.ranges();
|
||||
verify.referenceGroups(r0, [
|
||||
{ definition: "function foo(): void", ranges: [r0, r1] },
|
||||
{ definition: "(alias) function oof(): void\nimport oof", ranges: [r2] }
|
||||
|
|
|
@ -3,17 +3,16 @@
|
|||
// @noLib: true
|
||||
|
||||
////interface A {
|
||||
//// readonly [|{| "isDefinition": true |}x|]: number | string;
|
||||
//// [|readonly [|{| "isDefinition": true, "declarationRangeIndex": 0 |}x|]: number | string;|]
|
||||
////}
|
||||
////interface B extends A {
|
||||
//// readonly [|{| "isDefinition": true |}x|]: number;
|
||||
//// [|readonly [|{| "isDefinition": true, "declarationRangeIndex": 2 |}x|]: number;|]
|
||||
////}
|
||||
////const a: A = { [|{| "isWriteAccess": true, "isDefinition": true |}x|]: 0 };
|
||||
////const b: B = { [|{| "isWriteAccess": true, "isDefinition": true |}x|]: 0 };
|
||||
////const a: A = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}x|]: 0|] };
|
||||
////const b: B = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}x|]: 0|] };
|
||||
|
||||
const ranges = test.ranges();
|
||||
const [r0, r1, r2, r3] = ranges;
|
||||
verify.referenceGroups(ranges, [
|
||||
const [r0Def, r0, r1Def, r1, r2Def, r2, r3Def, r3] = test.ranges();
|
||||
verify.referenceGroups([r0, r1, r2, r3], [
|
||||
{ definition: "(property) A.x: string | number", ranges: [r0, r2] },
|
||||
{ definition: "(property) B.x: number", ranges: [r1, r3] },
|
||||
]);
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: /a.ts
|
||||
////export const [|{| "isWriteAccess": true, "isDefinition": true |}x|] = 0;
|
||||
////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] = 0;|]
|
||||
|
||||
//@Filename: /b.ts
|
||||
////import { [|x|] as [|{| "isWriteAccess": true, "isDefinition": true |}x|] } from "./a";
|
||||
////[|import { [|{| "declarationRangeIndex": 2 |}x|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}x|] } from "./a";|]
|
||||
////[|x|];
|
||||
|
||||
verify.noErrors();
|
||||
const [r0, r1, r2, r3] = test.ranges();
|
||||
const [r0Def, r0, r1Def, r1, r2, r3] = test.ranges();
|
||||
const aRanges = [r0, r1];
|
||||
const bRanges = [r2, r3];
|
||||
const aGroup = { definition: "const x: 0", ranges: aRanges };
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////interface I { [|{| "isDefinition": true |}x|]: {}; }
|
||||
////interface J { [|{| "isDefinition": true |}x|]: {}; }
|
||||
////declare const o: (I | J) & { [|{| "isWriteAccess": true, "isDefinition": true |}x|]: string };
|
||||
////interface I { [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}x|]: {};|] }
|
||||
////interface J { [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}x|]: {};|] }
|
||||
////declare const o: (I | J) & { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}x|]: string|] };
|
||||
////o.[|x|];
|
||||
|
||||
const [r0, r1, r2, r3] = test.ranges();
|
||||
const [r0Def, r0, r1Def, r1, r2Def, r2, r3] = test.ranges();
|
||||
const i = { definition: "(property) I.x: {}", ranges: [r0] };
|
||||
const j = { definition: "(property) J.x: {}", ranges: [r1] };
|
||||
const anon = { definition: "(property) x: string", ranges: [r2] };
|
||||
|
|
|
@ -21,10 +21,10 @@
|
|||
//// }
|
||||
////}
|
||||
////// These are *not* real uses of the 'this' keyword, they are identifiers.
|
||||
////const x = { [|{| "isWriteAccess": true, "isDefinition": true |}this|]: 0 }
|
||||
////const x = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 9 |}this|]: 0|] }
|
||||
////x.[|this|];
|
||||
|
||||
const [glob, f0, f1, g0, g1, x, y, constructor, method, propDef, propUse] = test.ranges();
|
||||
const [glob, f0, f1, g0, g1, x, y, constructor, method, propDefDef, propDef, propUse] = test.ranges();
|
||||
verify.singleReferenceGroup("this: typeof globalThis", [glob]);
|
||||
verify.singleReferenceGroup("(parameter) this: any", [f0, f1]);
|
||||
verify.singleReferenceGroup("(parameter) this: any", [g0, g1]);
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
// @Filename: /a.js
|
||||
/////**
|
||||
//// * @typedef I {Object}
|
||||
//// * @prop [|{| "isDefinition": true |}p|] {number}
|
||||
//// */
|
||||
//// * [|@prop [|{| "isDefinition": true, "declarationRangeIndex": 0 |}p|] {number}
|
||||
//// |]*/
|
||||
////
|
||||
/////** @type {I} */
|
||||
////let x;
|
||||
////x.[|p|];
|
||||
|
||||
verify.singleReferenceGroup("(property) p: number");
|
||||
verify.singleReferenceGroup("(property) p: number", test.rangesByText().get("p"));
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
|
||||
// @Filename: /a.js
|
||||
////module.exports = 0;
|
||||
/////** @typedef {number} [|{| "isWriteAccess": true, "isDefinition": true |}Foo|] */
|
||||
/////** [|@typedef {number} [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}Foo|]|] */
|
||||
////const dummy = 0;
|
||||
|
||||
// @Filename: /b.js
|
||||
/////** @type {import('./a').[|Foo|]} */
|
||||
////const x = 0;
|
||||
|
||||
verify.singleReferenceGroup("type Foo = number");
|
||||
verify.singleReferenceGroup("type Foo = number", test.rangesByText().get("Foo"));
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @Filename: /a.ts
|
||||
////export const [|{| "isWriteAccess": true, "isDefinition": true |}x|] = 0;
|
||||
////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] = 0;|]
|
||||
////declare const a: typeof import("./a");
|
||||
////a.[|x|];
|
||||
|
||||
verify.singleReferenceGroup("const x: 0");
|
||||
verify.singleReferenceGroup("const x: 0", test.rangesByText().get("x"));
|
||||
|
|
Loading…
Reference in a new issue