mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-09 07:55:10 -05:00
Change reference tests to verify actual ranges referenced and not just their count
This commit is contained in:
@@ -730,29 +730,6 @@ namespace FourSlash {
|
||||
}
|
||||
}
|
||||
|
||||
public verifyReferencesCountIs(count: number, localFilesOnly = true) {
|
||||
const references = this.getReferencesAtCaret();
|
||||
let referencesCount = 0;
|
||||
|
||||
if (localFilesOnly) {
|
||||
const localFiles = this.testData.files.map<string>(file => file.fileName);
|
||||
// Count only the references in local files. Filter the ones in lib and other files.
|
||||
ts.forEach(references, entry => {
|
||||
if (localFiles.some((fileName) => fileName === entry.fileName)) {
|
||||
referencesCount++;
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
referencesCount = references && references.length || 0;
|
||||
}
|
||||
|
||||
if (referencesCount !== count) {
|
||||
const condition = localFilesOnly ? "excluding libs" : "including libs";
|
||||
this.raiseError("Expected references count (" + condition + ") to be " + count + ", but is actually " + referencesCount);
|
||||
}
|
||||
}
|
||||
|
||||
public verifyReferencesAre(expectedReferences: Range[]) {
|
||||
const actualReferences = this.getReferencesAtCaret() || [];
|
||||
|
||||
@@ -760,7 +737,7 @@ namespace FourSlash {
|
||||
// Find the unaccounted-for reference.
|
||||
for (const actual of actualReferences) {
|
||||
if (!ts.forEach(expectedReferences, r => r.start === actual.textSpan.start)) {
|
||||
this.raiseError(`A reference ${actual} is unaccounted for.`);
|
||||
this.raiseError(`A reference ${stringify(actual)} is unaccounted for.`);
|
||||
}
|
||||
}
|
||||
// Probably will never reach here.
|
||||
@@ -769,7 +746,7 @@ namespace FourSlash {
|
||||
|
||||
for (const reference of expectedReferences) {
|
||||
const {fileName, start, end} = reference;
|
||||
if (reference.marker) {
|
||||
if (reference.marker && reference.marker.data) {
|
||||
const {isWriteAccess, isDefinition} = reference.marker.data;
|
||||
this.verifyReferencesWorker(actualReferences, fileName, start, end, isWriteAccess, isDefinition);
|
||||
}
|
||||
@@ -793,12 +770,8 @@ namespace FourSlash {
|
||||
}
|
||||
}
|
||||
|
||||
public verifyReferencesAtPositionListContains(fileName: string, start: number, end: number, isWriteAccess?: boolean, isDefinition?: boolean) {
|
||||
const references = this.getReferencesAtCaret();
|
||||
if (!references || references.length === 0) {
|
||||
this.raiseError("verifyReferencesAtPositionListContains failed - found 0 references, expected at least one.");
|
||||
}
|
||||
this.verifyReferencesWorker(references, fileName, start, end, isWriteAccess, isDefinition);
|
||||
public verifyRangesWithSameTextReferenceEachOther(ranges?: Range[]) {
|
||||
ts.forEachValue(this.rangesByText(), ranges => this.verifyRangesReferenceEachOther(ranges));
|
||||
}
|
||||
|
||||
private verifyReferencesWorker(references: ts.ReferenceEntry[], fileName: string, start: number, end: number, isWriteAccess?: boolean, isDefinition?: boolean) {
|
||||
@@ -817,7 +790,6 @@ namespace FourSlash {
|
||||
|
||||
const missingItem = { fileName, start, end, isWriteAccess, isDefinition };
|
||||
this.raiseError(`verifyReferencesAtPositionListContains failed - could not find the item: ${stringify(missingItem)} in the returned list: (${stringify(references)})`);
|
||||
|
||||
}
|
||||
|
||||
private getMemberListAtCaret() {
|
||||
@@ -1541,19 +1513,32 @@ namespace FourSlash {
|
||||
}
|
||||
|
||||
private updateMarkersForEdit(fileName: string, minChar: number, limChar: number, text: string) {
|
||||
for (let i = 0; i < this.testData.markers.length; i++) {
|
||||
const marker = this.testData.markers[i];
|
||||
for (const marker of this.testData.markers) {
|
||||
if (marker.fileName === fileName) {
|
||||
if (marker.position > minChar) {
|
||||
if (marker.position < limChar) {
|
||||
// Marker is inside the edit - mark it as invalidated (?)
|
||||
marker.position = -1;
|
||||
}
|
||||
else {
|
||||
// Move marker back/forward by the appropriate amount
|
||||
marker.position += (minChar - limChar) + text.length;
|
||||
}
|
||||
marker.position = updatePosition(marker.position);
|
||||
}
|
||||
}
|
||||
|
||||
for (const range of this.testData.ranges) {
|
||||
if (range.fileName === fileName) {
|
||||
range.start = updatePosition(range.start);
|
||||
range.end = updatePosition(range.end);
|
||||
}
|
||||
}
|
||||
|
||||
function updatePosition(position: number) {
|
||||
if (position > minChar) {
|
||||
if (position < limChar) {
|
||||
// Inside the edit - mark it as invalidated (?)
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
// Move marker back/forward by the appropriate amount
|
||||
return position + (minChar - limChar) + text.length;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return position;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1648,8 +1633,20 @@ namespace FourSlash {
|
||||
}
|
||||
|
||||
public getRanges(): Range[] {
|
||||
// Return a copy of the list
|
||||
return this.testData.ranges.slice(0);
|
||||
return this.testData.ranges;
|
||||
}
|
||||
|
||||
public rangesByText(): ts.Map<Range[]> {
|
||||
const result: ts.Map<Range[]> = {};
|
||||
for (const range of this.getRanges()) {
|
||||
const text = this.rangeText(range);
|
||||
(ts.getProperty(result, text) || (result[text] = [])).push(range);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private rangeText({fileName, start, end}: Range, more = false): string {
|
||||
return this.getFileContent(fileName).slice(start, end);
|
||||
}
|
||||
|
||||
public verifyCaretAtMarker(markerName = "") {
|
||||
@@ -2772,6 +2769,10 @@ namespace FourSlashInterface {
|
||||
return this.state.getRanges();
|
||||
}
|
||||
|
||||
public rangesByText(): ts.Map<FourSlash.Range[]> {
|
||||
return this.state.rangesByText();
|
||||
}
|
||||
|
||||
public markerByName(s: string): FourSlash.Marker {
|
||||
return this.state.getMarkerByName(s);
|
||||
}
|
||||
@@ -2970,10 +2971,6 @@ namespace FourSlashInterface {
|
||||
this.state.verifyGetEmitOutputContentsForCurrentFile(expected);
|
||||
}
|
||||
|
||||
public referencesCountIs(count: number) {
|
||||
this.state.verifyReferencesCountIs(count, /*localFilesOnly*/ false);
|
||||
}
|
||||
|
||||
public referencesAre(ranges: FourSlash.Range[]) {
|
||||
this.state.verifyReferencesAre(ranges);
|
||||
}
|
||||
@@ -2986,6 +2983,10 @@ namespace FourSlashInterface {
|
||||
this.state.verifyRangesReferenceEachOther(ranges);
|
||||
}
|
||||
|
||||
public rangesWithSameTextReferenceEachOther(ranges?: FourSlash.Range[]) {
|
||||
this.state.verifyRangesWithSameTextReferenceEachOther(ranges);
|
||||
}
|
||||
|
||||
public currentParameterHelpArgumentNameIs(name: string) {
|
||||
this.state.verifyCurrentParameterHelpName(name);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
////
|
||||
//// }
|
||||
////
|
||||
//// public /*1*/start(){
|
||||
//// public /**/[|start|](){
|
||||
//// return this;
|
||||
//// }
|
||||
////
|
||||
@@ -20,19 +20,14 @@
|
||||
////import Second = require("./findAllRefsOnDefinition-import");
|
||||
////
|
||||
////var second = new Second.Test()
|
||||
////second.start();
|
||||
////second.[|start|]();
|
||||
////second.stop();
|
||||
|
||||
goTo.file("findAllRefsOnDefinition-import.ts");
|
||||
goTo.marker("1");
|
||||
|
||||
verify.referencesCountIs(2);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
cancellation.setCancelled();
|
||||
goTo.marker("1");
|
||||
verifyOperationIsCancelled(() => verify.referencesCountIs(0) );
|
||||
verifyOperationIsCancelled(() => verify.rangesReferenceEachOther());
|
||||
|
||||
// verify that internal state is still correct
|
||||
cancellation.resetCancelled();
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(2);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -8,11 +8,9 @@
|
||||
////
|
||||
////var y = DefaultExportedFunction();
|
||||
////
|
||||
////namespace /**/DefaultExportedFunction {
|
||||
////namespace [|DefaultExportedFunction|] {
|
||||
////}
|
||||
|
||||
// The namespace and function do not merge,
|
||||
// so the namespace should be all alone.
|
||||
|
||||
goTo.marker();
|
||||
verify.referencesCountIs(1);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -7,11 +7,10 @@
|
||||
////
|
||||
////var y = new DefaultExportedClass;
|
||||
////
|
||||
////namespace /**/DefaultExportedClass {
|
||||
////namespace [|DefaultExportedClass|] {
|
||||
////}
|
||||
|
||||
// The namespace and class do not merge,
|
||||
// so the namespace should be all alone.
|
||||
|
||||
goTo.marker();
|
||||
verify.referencesCountIs(1);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
/// <reference path="fourslash.ts"/>
|
||||
|
||||
|
||||
////var Base = class { };
|
||||
////class C extends Base implements [|Base|] { }
|
||||
////class C extends Base implements /**/Base { }
|
||||
|
||||
let ranges = test.ranges();
|
||||
for (let range of ranges) {
|
||||
verify.referencesCountIs(0);
|
||||
}
|
||||
goTo.marker();
|
||||
verify.referencesAre([]);
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////var x = 0;
|
||||
////var [|x|] = 0;
|
||||
////
|
||||
////with ({}) {
|
||||
//// var y = x; // Reference of x here should not be picked
|
||||
//// /*2*/y++; // also reference for y should be ignored
|
||||
////}
|
||||
////
|
||||
////x = /*1*/x + 1;
|
||||
////[|x|] = [|x|] + 1;
|
||||
|
||||
goTo.marker('1');
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker('2');
|
||||
verify.referencesCountIs(0);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -10,4 +10,4 @@
|
||||
////}
|
||||
|
||||
goTo.marker();
|
||||
verify.referencesCountIs(0);
|
||||
verify.referencesAre([]);
|
||||
@@ -1,19 +1,16 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: a.ts
|
||||
////function decorator(target) {
|
||||
////function [|decorator|](target) {
|
||||
//// return target;
|
||||
////}
|
||||
////decorator();
|
||||
////[|decorator|]();
|
||||
|
||||
// @Filename: b.ts
|
||||
////@deco/*1*/rator @decorator("again")
|
||||
////@[|decorator|] @[|decorator|]("again")
|
||||
////class C {
|
||||
//// @decorator
|
||||
//// @[|decorator|]
|
||||
//// method() {}
|
||||
////}
|
||||
|
||||
goTo.file("b.ts");
|
||||
goTo.marker("1");
|
||||
|
||||
verify.referencesCountIs(5);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
////
|
||||
//// }
|
||||
////
|
||||
//// public /*1*/start(){
|
||||
//// public [|start|](){
|
||||
//// return this;
|
||||
//// }
|
||||
////
|
||||
@@ -20,10 +20,7 @@
|
||||
////import Second = require("./findAllRefsOnDefinition-import");
|
||||
////
|
||||
////var second = new Second.Test()
|
||||
////second.start();
|
||||
////second.[|start|]();
|
||||
////second.stop();
|
||||
|
||||
goTo.file("findAllRefsOnDefinition-import.ts");
|
||||
goTo.marker("1");
|
||||
|
||||
verify.referencesCountIs(2);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//@Filename: findAllRefsOnDefinition2-import.ts
|
||||
////export module Test{
|
||||
////
|
||||
//// export interface /*1*/start { }
|
||||
//// export interface [|start|] { }
|
||||
////
|
||||
//// export interface stop { }
|
||||
////}
|
||||
@@ -11,10 +11,7 @@
|
||||
//@Filename: findAllRefsOnDefinition2.ts
|
||||
////import Second = require("./findAllRefsOnDefinition2-import");
|
||||
////
|
||||
////var start: Second.Test.start;
|
||||
////var start: Second.Test.[|start|];
|
||||
////var stop: Second.Test.stop;
|
||||
|
||||
goTo.file("findAllRefsOnDefinition2-import.ts");
|
||||
goTo.marker("1");
|
||||
|
||||
verify.referencesCountIs(2);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -1,29 +1,15 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
//@Filename: a.ts
|
||||
////export class /*1*/Class{
|
||||
////export class [|Class|] {
|
||||
////}
|
||||
|
||||
//@Filename: b.ts
|
||||
////import { /*2*/Class } from "./a";
|
||||
////import { [|Class|] } from "./a";
|
||||
////
|
||||
////var c = new /*3*/Class();
|
||||
////var c = new [|Class|]();
|
||||
|
||||
//@Filename: c.ts
|
||||
////export { /*4*/Class } from "./a";
|
||||
|
||||
goTo.file("a.ts");
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(4);
|
||||
|
||||
goTo.file("b.ts");
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(4);
|
||||
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(4);
|
||||
|
||||
goTo.file("c.ts");
|
||||
goTo.marker("4");
|
||||
verify.referencesCountIs(4);
|
||||
////export { [|Class|] } from "./a";
|
||||
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -1,31 +1,15 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
//@Filename: a.ts
|
||||
////export class /*1*/Class{
|
||||
////export class [|Class|] {
|
||||
////}
|
||||
|
||||
//@Filename: b.ts
|
||||
////import { /*2*/Class as /*3*/C2} from "./a";
|
||||
////import { [|Class|] as [|C2|] } from "./a";
|
||||
////
|
||||
////var c = new C2();
|
||||
////var c = new [|C2|]();
|
||||
|
||||
//@Filename: c.ts
|
||||
////export { /*4*/Class as /*5*/C3 } from "./a";
|
||||
////export { [|Class|] as [|C3|] } from "./a";
|
||||
|
||||
goTo.file("a.ts");
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.file("b.ts");
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.file("c.ts");
|
||||
goTo.marker("4");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("5");
|
||||
verify.referencesCountIs(1);
|
||||
verify.rangesWithSameTextReferenceEachOther();
|
||||
|
||||
@@ -15,4 +15,4 @@ goTo.marker();
|
||||
|
||||
// TODO (drosen): The CURRENT behavior is that findAllRefs doesn't work on 'this' or 'super' keywords.
|
||||
// This should change down the line.
|
||||
verify.referencesCountIs(0);
|
||||
verify.referencesAre([]);
|
||||
@@ -1,19 +1,14 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// var /*1*/name = "Foo";
|
||||
//// var [|name|] = "Foo";
|
||||
////
|
||||
//// var obj = { /*2*/name };
|
||||
//// var obj1 = { /*3*/name:name };
|
||||
//// obj./*4*/name;
|
||||
//// var obj = { [|name|] };
|
||||
//// var obj1 = { [|name|]:[|name|] };
|
||||
//// obj.[|name|];
|
||||
|
||||
goTo.marker('1');
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker('2');
|
||||
verify.referencesCountIs(4);
|
||||
|
||||
goTo.marker('3');
|
||||
verify.referencesCountIs(1);
|
||||
|
||||
goTo.marker('4');
|
||||
verify.referencesCountIs(2);
|
||||
const [r0, r1, r2, r3, r4] = test.ranges();
|
||||
verify.referencesOf(r0, [r0, r1, r3]);
|
||||
verify.referencesOf(r1, [r0, r1, r3, r4]);
|
||||
verify.referencesOf(r2, [r2]);
|
||||
verify.referencesOf(r3, [r0, r1, r3]);
|
||||
verify.referencesOf(r4, [r1, r4]);
|
||||
|
||||
@@ -1,22 +1,16 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// var /*1*/dx = "Foo";
|
||||
//// var [|dx|] = "Foo";
|
||||
////
|
||||
//// module M { export var /*2*/dx; }
|
||||
//// module M { export var [|dx|]; }
|
||||
//// module M {
|
||||
//// var z = 100;
|
||||
//// export var y = { /*3*/dx, z };
|
||||
//// export var y = { [|dx|], z };
|
||||
//// }
|
||||
//// M.y./*4*/dx;
|
||||
//// M.y.[|dx|];
|
||||
|
||||
goTo.marker('1');
|
||||
verify.referencesCountIs(1);
|
||||
|
||||
goTo.marker('2');
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker('3');
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker('4');
|
||||
verify.referencesCountIs(2);
|
||||
const [r0, r1, r2, r3] = test.ranges();
|
||||
verify.referencesOf(r0, [r0]);
|
||||
verify.referencesOf(r1, [r1, r2]);
|
||||
verify.referencesOf(r2, [r1, r2, r3]);
|
||||
verify.referencesOf(r3, [r2, r3]);
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
//@Filename: a.ts
|
||||
////var /*1*/x: number;
|
||||
////var [|x|]: number;
|
||||
|
||||
//@Filename: b.ts
|
||||
/////// <reference path="a.ts" />
|
||||
////x++;
|
||||
////[|x|]++;
|
||||
|
||||
//@Filename: c.ts
|
||||
/////// <reference path="a.ts" />
|
||||
////x++;
|
||||
////[|x|]++;
|
||||
|
||||
goTo.file("a.ts");
|
||||
goTo.marker("1");
|
||||
|
||||
verify.referencesCountIs(3);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -2,21 +2,19 @@
|
||||
|
||||
// @Filename: a.ts
|
||||
////interface A {
|
||||
//// foo: string;
|
||||
//// [|foo|]: string;
|
||||
////}
|
||||
|
||||
// @Filename: b.ts
|
||||
///////<reference path='a.ts'/>
|
||||
/////*0*/
|
||||
/////**/
|
||||
////function foo(x: A) {
|
||||
//// x.f/*1*/oo
|
||||
//// x.[|foo|]
|
||||
////}
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(2);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
goTo.marker("0");
|
||||
goTo.marker("");
|
||||
edit.insert("\r\n");
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(2);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -1,22 +1,14 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// @Filename: index.tsx
|
||||
////import { /*1*/SubmissionComp } from "./RedditSubmission"
|
||||
////import { [|SubmissionComp|] } from "./RedditSubmission"
|
||||
////function displaySubreddit(subreddit: string) {
|
||||
//// let components = submissions
|
||||
//// .map((value, index) => </*2*/SubmissionComp key={ index } elementPosition= { index } {...value.data} />);
|
||||
//// .map((value, index) => <[|SubmissionComp|] key={ index } elementPosition= { index } {...value.data} />);
|
||||
////}
|
||||
|
||||
// @Filename: RedditSubmission.ts
|
||||
////export const /*3*/SubmissionComp = (submission: SubmissionProps) =>
|
||||
////export const [|SubmissionComp|] = (submission: SubmissionProps) =>
|
||||
//// <div style={{ fontFamily: "sans-serif" }}></div>;
|
||||
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(3);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// @Filename: index.tsx
|
||||
////const /*1*/obj = {Component: () => <div/>};
|
||||
////const element = </*2*/obj.Component/>;
|
||||
////const [|obj|] = {Component: () => <div/>};
|
||||
////const element = <[|obj|].Component/>;
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(2);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -100,6 +100,7 @@ declare namespace FourSlashInterface {
|
||||
markers(): Marker[];
|
||||
marker(name?: string): Marker;
|
||||
ranges(): Range[];
|
||||
rangesByText(): { [text: string]: Range[] };
|
||||
markerByName(s: string): Marker;
|
||||
}
|
||||
class goTo {
|
||||
@@ -152,7 +153,6 @@ declare namespace FourSlashInterface {
|
||||
currentFileContentIs(text: string): void;
|
||||
verifyGetEmitOutputForCurrentFile(expected: string): void;
|
||||
verifyGetEmitOutputContentsForCurrentFile(expected: ts.OutputFile[]): void;
|
||||
referencesCountIs(count: number): void;
|
||||
/**
|
||||
* Asserts that the given ranges are the references from the current position.
|
||||
* If ranges have markers, those markers may have "isDefinition" and "isWriteAccess" data
|
||||
@@ -170,6 +170,8 @@ declare namespace FourSlashInterface {
|
||||
* If `ranges` is omitted, this is `test.ranges()`.
|
||||
*/
|
||||
rangesReferenceEachOther(ranges?: Range[]): void;
|
||||
//doc
|
||||
rangesWithSameTextReferenceEachOther(ranges?: Range[]): void;
|
||||
currentParameterHelpArgumentNameIs(name: string): void;
|
||||
currentParameterSpanIs(parameter: string): void;
|
||||
currentParameterHelpArgumentDocCommentIs(docComment: string): void;
|
||||
|
||||
@@ -8,4 +8,4 @@ goTo.marker();
|
||||
verify.quickInfoIs("");
|
||||
verify.verifyDefinitionsName("", "");
|
||||
verify.typeDefinitionCountIs(0);
|
||||
verify.referencesCountIs(0);
|
||||
verify.referencesAre([]);
|
||||
|
||||
@@ -2,35 +2,39 @@
|
||||
|
||||
// @Filename: localGetReferences_1.ts
|
||||
////// Comment Refence Test: g/*1*/lobalVar
|
||||
////var g/*3*/lobalVar: n/*2*/umber = 2;
|
||||
////// References to a variable declared in global.
|
||||
////var [|globalVar|]: n/*2*/umber = 2;
|
||||
////
|
||||
////class fooCls {
|
||||
//// static clsS/*5*/Var = 1;
|
||||
//// //Declare
|
||||
//// cls/*4*/Var = 1;
|
||||
//// // References to static variable declared in a class.
|
||||
//// static [|clsSVar|] = 1;
|
||||
//// // References to a variable declared in a class.
|
||||
//// [|clsVar|] = 1;
|
||||
////
|
||||
//// constructor (public clsParam: number) {
|
||||
//// constructor (public [|clsParam|]: number) {
|
||||
//// //Increments
|
||||
//// globalVar++;
|
||||
//// this.clsVar++;
|
||||
//// fooCls.clsSVar++;
|
||||
//// this.cls/*7*/Param++;
|
||||
//// [|globalVar|]++;
|
||||
//// this.[|clsVar|]++;
|
||||
//// fooCls.[|clsSVar|]++;
|
||||
//// // References to a class parameter.
|
||||
//// this.[|clsParam|]++;
|
||||
//// modTest.modVar++;
|
||||
//// }
|
||||
////}
|
||||
////
|
||||
////function foo(/*8*/x: number) {
|
||||
//// //Declare
|
||||
//// var fn/*6*/Var = 1;
|
||||
////// References to a function parameter.
|
||||
////function [|foo|]([|x|]: number) {
|
||||
//// // References to a variable declared in a function.
|
||||
//// var [|fnVar|] = 1;
|
||||
////
|
||||
//// //Increments
|
||||
//// fooCls.clsSVar++;
|
||||
//// globalVar++;
|
||||
//// fooCls.[|clsSVar|]++;
|
||||
//// [|globalVar|]++;
|
||||
//// modTest.modVar++;
|
||||
//// fnVar++;
|
||||
//// [|fnVar|]++;
|
||||
////
|
||||
//// //Return
|
||||
//// return x++;
|
||||
//// return [|x|]++;
|
||||
////}
|
||||
////
|
||||
////module modTest {
|
||||
@@ -38,25 +42,25 @@
|
||||
//// export var modVar:number;
|
||||
////
|
||||
//// //Increments
|
||||
//// globalVar++;
|
||||
//// fooCls.clsSVar++;
|
||||
//// [|globalVar|]++;
|
||||
//// fooCls.[|clsSVar|]++;
|
||||
//// modVar++;
|
||||
////
|
||||
//// class testCls {
|
||||
//// static boo = foo;
|
||||
//// static boo = [|foo|];
|
||||
//// }
|
||||
////
|
||||
//// function testFn(){
|
||||
//// static boo = foo;
|
||||
//// static boo = [|foo|];
|
||||
////
|
||||
//// //Increments
|
||||
//// globalVar++;
|
||||
//// fooCls.clsSVar++;
|
||||
//// [|globalVar|]++;
|
||||
//// fooCls.[|clsSVar|]++;
|
||||
//// modVar++;
|
||||
//// }
|
||||
////
|
||||
//// module testMod {
|
||||
//// var boo = foo;
|
||||
//// var boo = [|foo|];
|
||||
//// }
|
||||
////}
|
||||
////
|
||||
@@ -64,24 +68,27 @@
|
||||
////var clsTest: fooCls;
|
||||
////
|
||||
//////Arguments
|
||||
////clsTest = new fooCls(globalV/*10*/ar);
|
||||
////foo(glo/*9*/balVar);
|
||||
////// References to a class argument.
|
||||
////clsTest = new fooCls([|globalVar|]);
|
||||
////// References to a function argument.
|
||||
////[|foo|]([|globalVar|]);
|
||||
////
|
||||
//////Increments
|
||||
////fooCls.clsSVar++;
|
||||
////fooCls.[|clsSVar|]++;
|
||||
////modTest.modVar++;
|
||||
////globalVar = globalVar + globalVar;
|
||||
////[|globalVar|] = [|globalVar|] + [|globalVar|];
|
||||
////
|
||||
//////ETC - Other cases
|
||||
////globalVar = 3;
|
||||
/////*11*/foo = foo + 1;
|
||||
/////*12*/err = err++;
|
||||
/////*13*/
|
||||
////[|globalVar|] = 3;
|
||||
////// References to illegal assignment.
|
||||
////[|foo|] = [|foo|] + 1;
|
||||
/////*3*/err = err++;
|
||||
/////*4*/
|
||||
//////Shadowed fn Parameter
|
||||
////function shdw(globa/*14*/lVar: number) {
|
||||
////function shdw([|{| "shadow": true |}globalVar|]: number) {
|
||||
//// //Increments
|
||||
//// globalVar++;
|
||||
//// return globalVar;
|
||||
//// [|{| "shadow": true |}globalVar|]++;
|
||||
//// return [|{| "shadow": true |}globalVar|];
|
||||
////}
|
||||
////
|
||||
//////Remotes
|
||||
@@ -110,11 +117,12 @@
|
||||
////array.forEach(
|
||||
////
|
||||
////
|
||||
////function(str) {
|
||||
////function([|str|]) {
|
||||
////
|
||||
////
|
||||
////
|
||||
//// return /*15*/str + " ";
|
||||
//// // Reference misses function parameter.
|
||||
//// return [|str|] + " ";
|
||||
////
|
||||
////});
|
||||
|
||||
@@ -162,7 +170,7 @@
|
||||
//// class remotetestCls {
|
||||
//// static remoteboo = remotefoo;
|
||||
//// }
|
||||
////
|
||||
////`
|
||||
//// function remotetestFn(){
|
||||
//// static remoteboo = remotefoo;
|
||||
////
|
||||
@@ -179,60 +187,30 @@
|
||||
|
||||
// References to comment.
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(0);
|
||||
verify.referencesAre([]);
|
||||
|
||||
// References to type.
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(0);
|
||||
|
||||
// References to a variable declared in global.
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(11);
|
||||
|
||||
// References to a variable declared in a class.
|
||||
goTo.marker("4");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
// References to static variable declared in a class.
|
||||
goTo.marker("5");
|
||||
verify.referencesCountIs(6);
|
||||
|
||||
// References to a variable declared in a function.
|
||||
goTo.marker("6");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
// References to a class parameter.
|
||||
goTo.marker("7");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
// References to a function parameter.
|
||||
goTo.marker("8");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
// References to a function argument.
|
||||
goTo.marker("9");
|
||||
verify.referencesCountIs(11);
|
||||
|
||||
// References to a class argument.
|
||||
goTo.marker("10");
|
||||
verify.referencesCountIs(11);
|
||||
|
||||
// References to illegal assignment.
|
||||
goTo.marker("11");
|
||||
verify.referencesCountIs(7);
|
||||
verify.referencesAre([]);
|
||||
|
||||
// References to unresolved symbol.
|
||||
goTo.marker("12");
|
||||
verify.referencesCountIs(0);
|
||||
goTo.marker("3");
|
||||
verify.referencesAre([]);
|
||||
|
||||
// References to no context.
|
||||
goTo.marker("13");
|
||||
verify.referencesCountIs(0);
|
||||
goTo.marker("4");
|
||||
verify.referencesAre([]);
|
||||
|
||||
// References to shadowed function parameter.
|
||||
goTo.marker("14");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
// Reference misses function parameter.
|
||||
goTo.marker("15");
|
||||
verify.referencesCountIs(2);
|
||||
const rangesByText = test.rangesByText();
|
||||
for (const text in rangesByText) {
|
||||
const ranges = rangesByText[text];
|
||||
if (text === "globalVar") {
|
||||
function isShadow(r) {
|
||||
return r.marker && r.marker.data && r.marker.data.shadow;
|
||||
}
|
||||
verify.rangesReferenceEachOther(ranges.filter(isShadow));
|
||||
verify.rangesReferenceEachOther(ranges.filter(r => !isShadow(r)));
|
||||
} else {
|
||||
verify.rangesReferenceEachOther(ranges);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,4 @@
|
||||
|
||||
goTo.marker('1');
|
||||
verify.quickInfoIs('module a');
|
||||
verify.referencesCountIs(0);
|
||||
verify.referencesAre([]);
|
||||
@@ -2,23 +2,19 @@
|
||||
|
||||
// @Filename: file1.ts
|
||||
//// class Foo {
|
||||
//// constructor(private /*0*/privateParam: number,
|
||||
//// public /*1*/publicParam: string,
|
||||
//// protected /*2*/protectedParam: boolean) {
|
||||
//// constructor(private [|privateParam|]: number,
|
||||
//// public [|publicParam|]: string,
|
||||
//// protected [|protectedParam|]: boolean) {
|
||||
////
|
||||
//// let localPrivate = /*3*/privateParam;
|
||||
//// this./*4*/privateParam += 10;
|
||||
//// let localPrivate = [|privateParam|];
|
||||
//// this.[|privateParam|] += 10;
|
||||
////
|
||||
//// let localPublic = /*5*/publicParam;
|
||||
//// this./*6*/publicParam += " Hello!";
|
||||
//// let localPublic = [|publicParam|];
|
||||
//// this.[|publicParam|] += " Hello!";
|
||||
////
|
||||
//// let localProtected = /*7*/protectedParam;
|
||||
//// this./*8*/protectedParam = false;
|
||||
//// let localProtected = [|protectedParam|];
|
||||
//// this.[|protectedParam|] = false;
|
||||
//// }
|
||||
//// }
|
||||
|
||||
let markers = test.markers()
|
||||
for (let marker of markers) {
|
||||
goTo.position(marker.position);
|
||||
verify.referencesCountIs(3);
|
||||
}
|
||||
verify.rangesWithSameTextReferenceEachOther();
|
||||
|
||||
@@ -3,18 +3,15 @@
|
||||
// Ensure BloomFilter building logic is correct, by having one reference per file
|
||||
|
||||
// @Filename: declaration.ts
|
||||
////var container = { /*1*/searchProp : 1 };
|
||||
////var container = { [|searchProp|] : 1 };
|
||||
|
||||
// @Filename: expression.ts
|
||||
////function blah() { return (1 + 2 + container./*2*/searchProp()) === 2; };
|
||||
////function blah() { return (1 + 2 + container.[|searchProp|]()) === 2; };
|
||||
|
||||
// @Filename: stringIndexer.ts
|
||||
////function blah2() { container[/*3*/"searchProp"] };
|
||||
////function blah2() { container["[|searchProp|]"] };
|
||||
|
||||
// @Filename: redeclaration.ts
|
||||
////container = { /*4*/"searchProp" : 18 };
|
||||
////container = { "[|searchProp|]" : 18 };
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.referencesCountIs(4);
|
||||
});
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -3,18 +3,15 @@
|
||||
// Ensure BloomFilter building logic is correct, by having one reference per file
|
||||
|
||||
// @Filename: declaration.ts
|
||||
////var container = { /*1*/42 : 1 };
|
||||
////var container = { [|42|]: 1 };
|
||||
|
||||
// @Filename: expression.ts
|
||||
////function blah() { return (container[/*2*/42]) === 2; };
|
||||
////function blah() { return (container[[|42|]]) === 2; };
|
||||
|
||||
// @Filename: stringIndexer.ts
|
||||
////function blah2() { container[/*3*/"42"] };
|
||||
////function blah2() { container["[|42|]"] };
|
||||
|
||||
// @Filename: redeclaration.ts
|
||||
////container = { /*4*/"42" : 18 };
|
||||
////container = { "[|42|]" : 18 };
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.referencesCountIs(4);
|
||||
});
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -4,13 +4,9 @@
|
||||
|
||||
|
||||
// @Filename: declaration.ts
|
||||
////enum Test { /*1*/"42" = 1 };
|
||||
////enum Test { "[|42|]" = 1 };
|
||||
|
||||
// @Filename: expression.ts
|
||||
////(Test[/*2*/42]);
|
||||
////(Test[[|42|]]);
|
||||
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.referencesCountIs(2);
|
||||
});
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -1,30 +1,21 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////declare module /*1*/"foo" {
|
||||
//// var f: number;
|
||||
////declare module "[|foo|]" {
|
||||
//// var [|f|]: number;
|
||||
////}
|
||||
////
|
||||
////declare module "bar" {
|
||||
//// export import foo = require(/*2*/"foo");
|
||||
//// var f2: typeof foo./*4*/f;
|
||||
////declare module "[|bar|]" {
|
||||
//// export import [|foo|] = require("[|foo|]");
|
||||
//// var f2: typeof [|foo|].[|f|];
|
||||
////}
|
||||
////
|
||||
////declare module "baz" {
|
||||
//// import bar = require(/*3*/"bar");
|
||||
//// var f2: typeof bar./*5*/foo;
|
||||
//// import bar = require("[|bar|]");
|
||||
//// var f2: typeof bar.[|foo|];
|
||||
////}
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("4");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("5");
|
||||
verify.referencesCountIs(3);
|
||||
const [moduleFoo0, f0, moduleBar0, foo0, moduleFoo1, foo1, f1, moduleBar1, foo2] = test.ranges();
|
||||
verify.rangesReferenceEachOther([moduleFoo0, moduleFoo1]);
|
||||
verify.rangesReferenceEachOther([moduleBar0, moduleBar1]);
|
||||
verify.rangesReferenceEachOther([foo0, foo1, foo2]);
|
||||
verify.rangesReferenceEachOther([f0, f1]);
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
////var n = 14;
|
||||
////
|
||||
////class foo {
|
||||
//// private /*1*/n = 0;
|
||||
//// private [|n|] = 0;
|
||||
////
|
||||
//// public bar() {
|
||||
//// this.n = 9;
|
||||
//// this.[|n|] = 9;
|
||||
//// }
|
||||
////
|
||||
//// constructor() {
|
||||
//// this./*2*/n = 4;
|
||||
//// this.[|n|] = 4;
|
||||
//// }
|
||||
////
|
||||
//// public bar2() {
|
||||
@@ -20,8 +20,4 @@
|
||||
//// }
|
||||
////}
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(3);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -1,32 +1,16 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////class Base {
|
||||
//// /*1*/a: number;
|
||||
//// /*2*/method(): void { }
|
||||
//// [|a|]: number;
|
||||
//// [|method|](): void { }
|
||||
////}
|
||||
////class MyClass extends Base {
|
||||
//// /*3*/a;
|
||||
//// /*4*/method() { }
|
||||
//// [|a|];
|
||||
//// [|method|]() { }
|
||||
////}
|
||||
////
|
||||
////var c: MyClass;
|
||||
////c./*5*/a;
|
||||
////c./*6*/method();
|
||||
////c.[|a|];
|
||||
////c.[|method|]();
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("4");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("5");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("6");
|
||||
verify.referencesCountIs(3);
|
||||
verify.rangesWithSameTextReferenceEachOther();
|
||||
|
||||
@@ -1,32 +1,16 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////abstract class Base {
|
||||
//// abstract /*1*/a: number;
|
||||
//// abstract /*2*/method(): void;
|
||||
//// abstract [|a|]: number;
|
||||
//// abstract [|method|](): void;
|
||||
////}
|
||||
////class MyClass extends Base {
|
||||
//// /*3*/a;
|
||||
//// /*4*/method() { }
|
||||
//// [|a|];
|
||||
//// [|method|]() { }
|
||||
////}
|
||||
////
|
||||
////var c: MyClass;
|
||||
////c./*5*/a;
|
||||
////c./*6*/method();
|
||||
////c.[|a|];
|
||||
////c.[|method|]();
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("4");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("5");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("6");
|
||||
verify.referencesCountIs(3);
|
||||
verify.rangesWithSameTextReferenceEachOther();
|
||||
|
||||
@@ -1,32 +1,16 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////class Base<T> {
|
||||
//// /*1*/a: this;
|
||||
//// /*2*/method<U>(a?:T, b?:U): this { }
|
||||
//// [|a|]: this;
|
||||
//// [|method|]<U>(a?:T, b?:U): this { }
|
||||
////}
|
||||
////class MyClass extends Base<number> {
|
||||
//// /*3*/a;
|
||||
//// /*4*/method() { }
|
||||
//// [|a|];
|
||||
//// [|method|]() { }
|
||||
////}
|
||||
////
|
||||
////var c: MyClass;
|
||||
////c./*5*/a;
|
||||
////c./*6*/method();
|
||||
////c.[|a|];
|
||||
////c.[|method|]();
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("4");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("5");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("6");
|
||||
verify.referencesCountIs(3);
|
||||
verify.rangesWithSameTextReferenceEachOther();
|
||||
|
||||
@@ -7,20 +7,16 @@
|
||||
////class p { }
|
||||
////
|
||||
////class foo {
|
||||
//// constructor (public p: any) {
|
||||
//// constructor (public [|p|]: any) {
|
||||
//// }
|
||||
////
|
||||
//// public f(p) {
|
||||
//// this./*1*/p = p;
|
||||
//// this.[|p|] = p;
|
||||
//// }
|
||||
////
|
||||
////}
|
||||
////
|
||||
////var n = new foo(undefined);
|
||||
////n./*2*/p = null;
|
||||
////n.[|p|] = null;
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(3);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -1,32 +1,28 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////interface IFoo { /*1*/xy: number; }
|
||||
////interface IFoo { [|xy|]: number; }
|
||||
////
|
||||
////// Assignment
|
||||
////var a1: IFoo = { /*2*/xy: 0 };
|
||||
////var a2: IFoo = { xy: 0 };
|
||||
////var a1: IFoo = { [|xy|]: 0 };
|
||||
////var a2: IFoo = { [|xy|]: 0 };
|
||||
////
|
||||
////// Function call
|
||||
////function consumer(f: IFoo) { }
|
||||
////consumer({ xy: 1 });
|
||||
////consumer({ [|xy|]: 1 });
|
||||
////
|
||||
////// Type cast
|
||||
////var c = <IFoo>{ xy: 0 };
|
||||
////var c = <IFoo>{ [|xy|]: 0 };
|
||||
////
|
||||
////// Array literal
|
||||
////var ar: IFoo[] = [{ xy: 1 }, { /*3*/xy: 2 }];
|
||||
////var ar: IFoo[] = [{ [|xy|]: 1 }, { [|xy|]: 2 }];
|
||||
////
|
||||
////// Nested object literal
|
||||
////var ob: { ifoo: IFoo } = { ifoo: { xy: 0 } };
|
||||
////var ob: { ifoo: IFoo } = { ifoo: { [|xy|]: 0 } };
|
||||
////
|
||||
////// Widened type
|
||||
////var w: IFoo = { /*4*/xy: undefined };
|
||||
////var w: IFoo = { [|xy|]: undefined };
|
||||
////
|
||||
////// Untped -- should not be included
|
||||
////var u = { xy: 0 };
|
||||
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.referencesCountIs(9);
|
||||
});
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -2,39 +2,42 @@
|
||||
|
||||
////interface A {
|
||||
//// a: number;
|
||||
//// common: string;
|
||||
//// [|common|]: string;
|
||||
////}
|
||||
////
|
||||
////interface B {
|
||||
//// b: number;
|
||||
//// common: number;
|
||||
//// [|common|]: number;
|
||||
////}
|
||||
////
|
||||
////// Assignment
|
||||
////var v1: A | B = { a: 0, /*1*/common: "" };
|
||||
////var v2: A | B = { b: 0, /*2*/common: 3 };
|
||||
////var v1: A | B = { a: 0, [|common|]: "" };
|
||||
////var v2: A | B = { b: 0, [|common|]: 3 };
|
||||
////
|
||||
////// Function call
|
||||
////function consumer(f: A | B) { }
|
||||
////consumer({ a: 0, b: 0, /*3*/common: 1 });
|
||||
////consumer({ a: 0, b: 0, [|common|]: 1 });
|
||||
////
|
||||
////// Type cast
|
||||
////var c = <A | B> { /*4*/common: 0, b: 0 };
|
||||
////var c = <A | B> { [|common|]: 0, b: 0 };
|
||||
////
|
||||
////// Array literal
|
||||
////var ar: Array<A|B> = [{ a: 0, /*5*/common: "" }, { b: 0, /*6*/common: 0 }];
|
||||
////var ar: Array<A|B> = [{ a: 0, [|common|]: "" }, { b: 0, [|common|]: 0 }];
|
||||
////
|
||||
////// Nested object literal
|
||||
////var ob: { aorb: A|B } = { aorb: { b: 0, /*7*/common: 0 } };
|
||||
////var ob: { aorb: A|B } = { aorb: { b: 0, [|common|]: 0 } };
|
||||
////
|
||||
////// Widened type
|
||||
////var w: A|B = { a:0, /*8*/common: undefined };
|
||||
////var w: A|B = { a:0, [|common|]: undefined };
|
||||
////
|
||||
////// Untped -- should not be included
|
||||
////var u1 = { a: 0, b: 0, common: "" };
|
||||
////var u2 = { b: 0, common: 0 };
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.referencesCountIs(10); // 8 contextually typed common, and 2 in definition (A.common, B.common)
|
||||
});
|
||||
const all = test.ranges();
|
||||
const [aCommon, bCommon, ...unionRefs] = all;
|
||||
verify.referencesOf(aCommon, [aCommon, ...unionRefs]);
|
||||
verify.referencesOf(bCommon, [bCommon, ...unionRefs]);
|
||||
for (const ref of unionRefs) {
|
||||
verify.referencesOf(ref, all);
|
||||
}
|
||||
|
||||
@@ -6,35 +6,32 @@
|
||||
////}
|
||||
////
|
||||
////interface B {
|
||||
//// /*1*/b: number;
|
||||
//// [|b|]: number;
|
||||
//// common: number;
|
||||
////}
|
||||
////
|
||||
////// Assignment
|
||||
////var v1: A | B = { a: 0, common: "" };
|
||||
////var v2: A | B = { /*2*/b: 0, common: 3 };
|
||||
////var v2: A | B = { [|b|]: 0, common: 3 };
|
||||
////
|
||||
////// Function call
|
||||
////function consumer(f: A | B) { }
|
||||
////consumer({ a: 0, /*3*/b: 0, common: 1 });
|
||||
////consumer({ a: 0, [|b|]: 0, common: 1 });
|
||||
////
|
||||
////// Type cast
|
||||
////var c = <A | B> { common: 0, /*4*/b: 0 };
|
||||
////var c = <A | B> { common: 0, [|b|]: 0 };
|
||||
////
|
||||
////// Array literal
|
||||
////var ar: Array<A|B> = [{ a: 0, common: "" }, { /*5*/b: 0, common: 0 }];
|
||||
////var ar: Array<A|B> = [{ a: 0, common: "" }, { [|b|]: 0, common: 0 }];
|
||||
////
|
||||
////// Nested object literal
|
||||
////var ob: { aorb: A|B } = { aorb: { /*6*/b: 0, common: 0 } };
|
||||
////var ob: { aorb: A|B } = { aorb: { [|b|]: 0, common: 0 } };
|
||||
////
|
||||
////// Widened type
|
||||
////var w: A|B = { /*7*/b:undefined, common: undefined };
|
||||
////var w: A|B = { [|b|]:undefined, common: undefined };
|
||||
////
|
||||
////// Untped -- should not be included
|
||||
////var u1 = { a: 0, b: 0, common: "" };
|
||||
////var u2 = { b: 0, common: 0 };
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.referencesCountIs(7);
|
||||
});
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -1,22 +1,14 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////enum E {
|
||||
//// /*value1*/value1 = 1,
|
||||
//// "value2" = value1,
|
||||
//// 111 = 11
|
||||
//// [|value1|] = 1,
|
||||
//// "[|value2|]" = [|value1|],
|
||||
//// [|111|] = 11
|
||||
////}
|
||||
////
|
||||
////E.value1;
|
||||
////E["value2"];
|
||||
////E./*value2*/value2;
|
||||
////E[/*value3*/111];
|
||||
////E.[|value1|];
|
||||
////E["[|value2|]"];
|
||||
////E.[|value2|];
|
||||
////E[[|111|]];
|
||||
|
||||
|
||||
goTo.marker("value1");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("value2");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("value3");
|
||||
verify.referencesCountIs(2);
|
||||
verify.rangesWithSameTextReferenceEachOther();
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////module M {
|
||||
//// export var /*1*/variable = 0;
|
||||
//// export var [|variable|] = 0;
|
||||
////
|
||||
//// // local use
|
||||
//// var x = /*2*/variable;
|
||||
//// var x = [|variable|];
|
||||
////}
|
||||
////
|
||||
////// external use
|
||||
////M./*3*/variable
|
||||
////M.[|variable|]
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.referencesCountIs(3);
|
||||
});
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -3,16 +3,12 @@
|
||||
// Global interface reference.
|
||||
|
||||
// @Filename: referencesForGlobals_1.ts
|
||||
////declare module /*1*/"foo" {
|
||||
////declare module "[|foo|]" {
|
||||
//// var f: number;
|
||||
////}
|
||||
|
||||
|
||||
// @Filename: referencesForGlobals_2.ts
|
||||
////import f = require(/*2*/"foo");
|
||||
////import f = require("[|foo|]");
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(2);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -2,16 +2,9 @@
|
||||
|
||||
// Function overloads should be highlighted together.
|
||||
|
||||
////function /*1*/foo(x: string);
|
||||
////function /*2*/foo(x: string, y: number) {
|
||||
//// /*3*/foo('', 43);
|
||||
////function [|foo|](x: string);
|
||||
////function [|foo|](x: string, y: number) {
|
||||
//// [|foo|]('', 43);
|
||||
////}
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(3);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -3,13 +3,9 @@
|
||||
////var x;
|
||||
////var n;
|
||||
////
|
||||
////function n(x: number, /*1*/n: number) {
|
||||
//// /*2*/n = 32;
|
||||
//// x = n;
|
||||
////function n(x: number, [|n|]: number) {
|
||||
//// [|n|] = 32;
|
||||
//// x = [|n|];
|
||||
////}
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(3);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// Global variable reference.
|
||||
|
||||
// @Filename: referencesForGlobals_1.ts
|
||||
////var /*1*/global = 2;
|
||||
////var [|global|] = 2;
|
||||
////
|
||||
////class foo {
|
||||
//// constructor (public global) { }
|
||||
@@ -13,20 +13,16 @@
|
||||
////
|
||||
////class bar {
|
||||
//// constructor () {
|
||||
//// var n = global;
|
||||
//// var n = [|global|];
|
||||
////
|
||||
//// var f = new foo('');
|
||||
//// f.global = '';
|
||||
//// }
|
||||
////}
|
||||
////
|
||||
////var k = global;
|
||||
////var k = [|global|];
|
||||
|
||||
// @Filename: referencesForGlobals_2.ts
|
||||
////var m = global;
|
||||
////var m = [|global|];
|
||||
|
||||
// this line triggers a semantic/syntactic error check, remove line when 788570 is fixed
|
||||
edit.insert('');
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(4);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -3,15 +3,11 @@
|
||||
// Global class reference.
|
||||
|
||||
// @Filename: referencesForGlobals_1.ts
|
||||
////class /*2*/globalClass {
|
||||
////class [|globalClass|] {
|
||||
//// public f() { }
|
||||
////}
|
||||
|
||||
// @Filename: referencesForGlobals_2.ts
|
||||
////var c = /*1*/globalClass();
|
||||
////var c = [|globalClass|]();
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(2);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -3,15 +3,11 @@
|
||||
// Global interface reference.
|
||||
|
||||
// @Filename: referencesForGlobals_1.ts
|
||||
////interface /*2*/globalInterface {
|
||||
////interface [|globalInterface|] {
|
||||
//// f();
|
||||
////}
|
||||
|
||||
// @Filename: referencesForGlobals_2.ts
|
||||
////var i: /*1*/globalInterface;
|
||||
////var i: [|globalInterface|];
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(2);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -3,15 +3,11 @@
|
||||
// Global module reference.
|
||||
|
||||
// @Filename: referencesForGlobals_1.ts
|
||||
////module /*2*/globalModule {
|
||||
////module [|globalModule|] {
|
||||
//// export f() { };
|
||||
////}
|
||||
|
||||
// @Filename: referencesForGlobals_2.ts
|
||||
////var m = /*1*/globalModule;
|
||||
////var m = [|globalModule|];
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(2);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -7,13 +7,9 @@
|
||||
//// export var x;
|
||||
////}
|
||||
////
|
||||
////import /*2*/globalAlias = globalModule;
|
||||
////import [|globalAlias|] = globalModule;
|
||||
|
||||
// @Filename: referencesForGlobals_2.ts
|
||||
////var m = /*1*/globalAlias;
|
||||
////var m = [|globalAlias|];
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(2);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -2,23 +2,20 @@
|
||||
|
||||
// Global variable reference.
|
||||
|
||||
////var /*1*/topLevelVar = 2;
|
||||
////var topLevelVar2 = topLevelVar;
|
||||
////var [|topLevelVar|] = 2;
|
||||
////var topLevelVar2 = [|topLevelVar|];
|
||||
////
|
||||
////class /*2*/topLevelClass { }
|
||||
////var c = new topLevelClass();
|
||||
////class [|topLevelClass|] { }
|
||||
////var c = new [|topLevelClass|]();
|
||||
////
|
||||
////interface topLevelInterface { }
|
||||
////var i: /*3*/topLevelInterface;
|
||||
////interface [|topLevelInterface|] { }
|
||||
////var i: [|topLevelInterface|];
|
||||
////
|
||||
////module topLevelModule {
|
||||
////module [|topLevelModule|] {
|
||||
//// export var x;
|
||||
////}
|
||||
////var x = /*4*/topLevelModule.x;
|
||||
////var x = [|topLevelModule|].x;
|
||||
////
|
||||
////export = x;
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.referencesCountIs(2);
|
||||
});
|
||||
verify.rangesWithSameTextReferenceEachOther();
|
||||
|
||||
@@ -2,20 +2,13 @@
|
||||
|
||||
////f/*1*/oo = fo/*2*/o;
|
||||
|
||||
////var /*3*/bar = function () { };
|
||||
////ba/*4*/r = b/*5*/ar + 1;
|
||||
////var [|bar|] = function () { };
|
||||
////[|bar|] = [|bar|] + 1;
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(0);
|
||||
verify.referencesAre([]);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(0);
|
||||
verify.referencesAre([]);
|
||||
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("4");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("5");
|
||||
verify.referencesCountIs(3);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -5,19 +5,11 @@
|
||||
//// export = $;
|
||||
////}
|
||||
|
||||
////import [|$|] = require("jquery");
|
||||
////[|$|]("a");
|
||||
|
||||
////import /*1*/$ = require("jquery");
|
||||
/////*2*/$("a");
|
||||
////import [|$|] = require("jquery");
|
||||
|
||||
|
||||
////import /*3*/$ = require("jquery");
|
||||
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(1);
|
||||
const [r0, r1, r2] = test.ranges();
|
||||
verify.rangesReferenceEachOther([r0, r1]);
|
||||
verify.referencesOf(r2, [r2]);
|
||||
|
||||
@@ -3,16 +3,12 @@
|
||||
// References a class property using string index access
|
||||
|
||||
////class Foo {
|
||||
//// property: number;
|
||||
//// method(): void { }
|
||||
//// [|property|]: number;
|
||||
//// [|method|](): void { }
|
||||
////}
|
||||
////
|
||||
////var f: Foo;
|
||||
////f[/*1*/"property"];
|
||||
////f[/*2*/"method"];
|
||||
////f["[|property|]"];
|
||||
////f["[|method|]"];
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(2);
|
||||
verify.rangesWithSameTextReferenceEachOther();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// References to a unknown index property
|
||||
|
||||
////var a;
|
||||
////a[/*1*/"blah"];
|
||||
////a[/**/"blah"];
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(0);
|
||||
goTo.marker("");
|
||||
verify.referencesAre([]);
|
||||
|
||||
@@ -3,17 +3,13 @@
|
||||
// References to a property of the apparent type using string indexer
|
||||
|
||||
////interface Object {
|
||||
//// toMyString();
|
||||
//// [|toMyString|]();
|
||||
////}
|
||||
////
|
||||
////var y: Object;
|
||||
////y./*1*/toMyString();
|
||||
////y.[|toMyString|]();
|
||||
////
|
||||
////var x = {};
|
||||
////x[/*2*/"toMyString"]();
|
||||
////x["[|toMyString|]"]();
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(3);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////interface interface1 {
|
||||
//// /*1*/doStuff(): void;
|
||||
//// [|doStuff|](): void;
|
||||
////}
|
||||
////
|
||||
////interface interface2 extends interface1{
|
||||
//// /*2*/doStuff(): void;
|
||||
//// [|doStuff|](): void;
|
||||
////}
|
||||
////
|
||||
////class class1 implements interface2 {
|
||||
//// /*3*/doStuff() {
|
||||
//// [|doStuff|]() {
|
||||
////
|
||||
//// }
|
||||
////}
|
||||
@@ -19,9 +19,6 @@
|
||||
////}
|
||||
////
|
||||
////var v: class2;
|
||||
////v./*4*/doStuff();
|
||||
////v.[|doStuff|]();
|
||||
|
||||
test.markers().forEach(m=> {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.referencesCountIs(4);
|
||||
});
|
||||
verify.rangesWithSameTextReferenceEachOther();
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
// extends statement in a diffrent declaration
|
||||
|
||||
////interface interface1 {
|
||||
//// /*1*/doStuff(): void;
|
||||
//// [|doStuff|](): void;
|
||||
////}
|
||||
////
|
||||
////interface interface2 {
|
||||
//// /*2*/doStuff(): void;
|
||||
//// [|doStuff|](): void;
|
||||
////}
|
||||
////
|
||||
////interface interface2 extends interface1 {
|
||||
////}
|
||||
////
|
||||
////class class1 implements interface2 {
|
||||
//// /*3*/doStuff() {
|
||||
//// [|doStuff|]() {
|
||||
////
|
||||
//// }
|
||||
////}
|
||||
@@ -24,9 +24,6 @@
|
||||
////}
|
||||
////
|
||||
////var v: class2;
|
||||
////v./*4*/doStuff();
|
||||
////v.[|doStuff|]();
|
||||
|
||||
test.markers().forEach(m=> {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.referencesCountIs(4);
|
||||
});
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// interface interface1 extends interface1 {
|
||||
//// /*1*/doStuff(): void;
|
||||
//// /*2*/propName: string;
|
||||
//// [|doStuff|](): void;
|
||||
//// [|propName|]: string;
|
||||
//// }
|
||||
////
|
||||
//// var v: interface1;
|
||||
//// v./*3*/propName;
|
||||
//// v./*4*/doStuff();
|
||||
//// v.[|propName|];
|
||||
//// v.[|doStuff|]();
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.referencesCountIs(2);
|
||||
});
|
||||
verify.rangesWithSameTextReferenceEachOther();
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// class class1 extends class1 {
|
||||
//// /*1*/doStuff() { }
|
||||
//// /*2*/propName: string;
|
||||
//// [|doStuff|]() { }
|
||||
//// [|propName|]: string;
|
||||
//// }
|
||||
////
|
||||
//// var c: class1;
|
||||
//// c./*3*/doStuff();
|
||||
//// c./*4*/propName;
|
||||
//// c.[|doStuff|]();
|
||||
//// c.[|propName|];
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.referencesCountIs(2);
|
||||
});
|
||||
verify.rangesWithSameTextReferenceEachOther();
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// interface interface1 extends interface1 {
|
||||
//// /*1*/doStuff(): void;
|
||||
//// /*2*/propName: string;
|
||||
//// [|doStuff|](): void;
|
||||
//// [|propName|]: string;
|
||||
//// }
|
||||
//// interface interface2 extends interface1 {
|
||||
//// /*3*/doStuff(): void;
|
||||
//// /*4*/propName: string;
|
||||
//// [|doStuff|](): void;
|
||||
//// [|propName|]: string;
|
||||
//// }
|
||||
////
|
||||
//// var v: interface1;
|
||||
//// v./*5*/propName;
|
||||
//// v./*6*/doStuff();
|
||||
//// v.[|propName|];
|
||||
//// v.[|doStuff|]();
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.referencesCountIs(3);
|
||||
});
|
||||
verify.rangesWithSameTextReferenceEachOther();
|
||||
|
||||
@@ -1,32 +1,16 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// class class1 extends class1 {
|
||||
//// /*1*/doStuff() { }
|
||||
//// /*2*/propName: string;
|
||||
//// [|doStuff|]() { }
|
||||
//// [|propName|]: string;
|
||||
//// }
|
||||
//// class class2 extends class1 {
|
||||
//// /*3*/doStuff() { }
|
||||
//// /*4*/propName: string;
|
||||
//// [|doStuff|]() { }
|
||||
//// [|propName|]: string;
|
||||
//// }
|
||||
////
|
||||
//// var v: class2;
|
||||
//// v./*5*/propName;
|
||||
//// v./*6*/doStuff();
|
||||
//// v.[|propName|];
|
||||
//// v.[|doStuff|]();
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("4");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("5");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("6");
|
||||
verify.referencesCountIs(3);
|
||||
verify.rangesWithSameTextReferenceEachOther();
|
||||
|
||||
@@ -1,42 +1,30 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// class class1 extends class1 {
|
||||
//// /*1*/doStuff() { }
|
||||
//// /*2*/propName: string;
|
||||
//// [|doStuff|]() { }
|
||||
//// [|propName|]: string;
|
||||
//// }
|
||||
//// interface interface1 extends interface1 {
|
||||
//// /*3*/doStuff(): void;
|
||||
//// /*4*/propName: string;
|
||||
//// [|doStuff|](): void;
|
||||
//// [|propName|]: string;
|
||||
//// }
|
||||
//// class class2 extends class1 implements interface1 {
|
||||
//// /*5*/doStuff() { }
|
||||
//// /*6*/propName: string;
|
||||
//// [|doStuff|]() { }
|
||||
//// [|propName|]: string;
|
||||
//// }
|
||||
////
|
||||
//// var v: class2;
|
||||
//// v./*7*/propName;
|
||||
//// v./*8*/doStuff();
|
||||
//// v.[|propName|];
|
||||
//// v.[|doStuff|]();
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("4");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("5");
|
||||
verify.referencesCountIs(4);
|
||||
|
||||
goTo.marker("6");
|
||||
verify.referencesCountIs(4);
|
||||
|
||||
goTo.marker("7");
|
||||
verify.referencesCountIs(4);
|
||||
|
||||
goTo.marker("8");
|
||||
verify.referencesCountIs(4);
|
||||
const [r0, r1, r2, r3, r4, r5, r6, r7] = test.ranges();
|
||||
verify.referencesOf(r0, [r0, r4, r7]);
|
||||
verify.referencesOf(r1, [r1, r5, r6]);
|
||||
verify.referencesOf(r2, [r2, r4, r7]);
|
||||
verify.referencesOf(r3, [r3, r5, r6]);
|
||||
const allDoStuff = [r0, r2, r4, r7];
|
||||
verify.referencesOf(r4, allDoStuff);
|
||||
const allPropName = [r1, r3, r5, r6];
|
||||
verify.referencesOf(r5, allPropName);
|
||||
verify.referencesOf(r6, allPropName);
|
||||
verify.referencesOf(r7, allDoStuff);
|
||||
|
||||
@@ -1,27 +1,16 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// interface C extends D {
|
||||
//// /*0*/propD: number;
|
||||
//// [|propD|]: number;
|
||||
//// }
|
||||
//// interface D extends C {
|
||||
//// /*1*/propD: string;
|
||||
//// /*3*/propC: number;
|
||||
//// [|propD|]: string;
|
||||
//// [|propC|]: number;
|
||||
//// }
|
||||
//// var d: D;
|
||||
//// d./*2*/propD;
|
||||
//// d./*4*/propC;
|
||||
//// d.[|propD|];
|
||||
//// d.[|propC|];
|
||||
|
||||
goTo.marker("0");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("4");
|
||||
verify.referencesCountIs(2);
|
||||
const [d0, d1, c0, d2, c1] = test.ranges();
|
||||
verify.rangesReferenceEachOther([d0, d1, d2]);
|
||||
verify.rangesReferenceEachOther([c0, c1]);
|
||||
|
||||
@@ -1,21 +1,16 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// class D extends C {
|
||||
//// /*0*/prop1: string;
|
||||
//// [|prop1|]: string;
|
||||
//// }
|
||||
////
|
||||
//// class C extends D {
|
||||
//// /*1*/prop1: string;
|
||||
//// [|prop1|]: string;
|
||||
//// }
|
||||
////
|
||||
//// var c: C;
|
||||
//// c./*2*/prop1;
|
||||
//// c.[|prop1|];
|
||||
|
||||
goTo.marker("0");
|
||||
verify.referencesCountIs(1);
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(2)
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(2)
|
||||
const [r0, r1, r2] = test.ranges();
|
||||
verify.referencesOf(r0, [r0]);
|
||||
verify.rangesReferenceEachOther([r1, r2]);
|
||||
|
||||
@@ -2,22 +2,14 @@
|
||||
|
||||
// Valid References for a label
|
||||
|
||||
/////*1*/label: while (true) {
|
||||
//// if (false) break /*2*/label;
|
||||
//// if (true) continue /*3*/label;
|
||||
////[|label|]: while (true) {
|
||||
//// if (false) break [|label|];
|
||||
//// if (true) continue [|label|];
|
||||
////}
|
||||
////
|
||||
/////*4*/label: while (false) { }
|
||||
////[|label|]: while (false) { }
|
||||
////var label = "label";
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("4");
|
||||
verify.referencesCountIs(1);
|
||||
const [r0, r1, r2, r3] = test.ranges();
|
||||
verify.rangesReferenceEachOther([r0, r1, r2]);
|
||||
verify.referencesOf(r3, [r3]);
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
////var label = "label";
|
||||
////while (true) {
|
||||
//// if (false) break /*1*/label;
|
||||
//// if (false) break /**/label;
|
||||
//// if (true) continue label;
|
||||
////}
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(0);
|
||||
goTo.marker();
|
||||
verify.referencesAre([]);
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
// References to unused label
|
||||
|
||||
/////*1*/label: while (true) {
|
||||
////[|label|]: while (true) {
|
||||
//// var label = "label";
|
||||
////}
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(1);
|
||||
const [label] = test.ranges();
|
||||
verify.referencesOf(label, [label]);
|
||||
|
||||
@@ -2,14 +2,10 @@
|
||||
|
||||
// References to a label outside function bounderies
|
||||
|
||||
/////*1*/label: function foo(label) {
|
||||
////[|label|]: function foo(label) {
|
||||
//// while (true) {
|
||||
//// break /*2*/label;
|
||||
//// break [|label|];
|
||||
//// }
|
||||
////}
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(2);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -2,27 +2,16 @@
|
||||
|
||||
// References to shadowed label
|
||||
|
||||
/////*outer1*/label: while (true) {
|
||||
//// if (false) break /*outer2*/label;
|
||||
////[|label|]: while (true) {
|
||||
//// if (false) break [|label|];
|
||||
//// function blah() {
|
||||
/////*inner1*/label: while (true) {
|
||||
//// if (false) break /*inner2*/label;
|
||||
////[|label|]: while (true) {
|
||||
//// if (false) break [|label|];
|
||||
//// }
|
||||
//// }
|
||||
//// if (false) break /*outer3*/label;
|
||||
//// if (false) break [|label|];
|
||||
//// }
|
||||
|
||||
goTo.marker("outer1");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("outer2");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("outer3");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("inner1");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("inner2");
|
||||
verify.referencesCountIs(2);
|
||||
const [outer1, outer2, inner1, inner2, outer3] = test.ranges();
|
||||
verify.rangesReferenceEachOther([outer1, outer2, outer3]);
|
||||
verify.rangesReferenceEachOther([inner1, inner2]);
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// References to lable wiht close names
|
||||
// References to labels with close names
|
||||
|
||||
/////*1*/labela: while (true) {
|
||||
/////*2*/labelb: while (false) { break labelb; }
|
||||
////[|labela|]: while (true) {
|
||||
////[|labelb|]: while (false) { break [|labelb|]; }
|
||||
//// break labelc;
|
||||
////}
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(1);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(2);
|
||||
const [a, b, useB] = test.ranges();
|
||||
verify.referencesOf(a, [a]);
|
||||
verify.rangesReferenceEachOther([b, useB]);
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////interface /*type1*/Foo {
|
||||
////interface [|Foo|] {
|
||||
////}
|
||||
////
|
||||
////module /*namespace1*/Foo {
|
||||
////module [|Foo|] {
|
||||
//// export interface Bar { }
|
||||
////}
|
||||
////
|
||||
////function /*value1*/Foo(): void {
|
||||
////function [|Foo|](): void {
|
||||
////}
|
||||
////
|
||||
////var f1: /*namespace2*/Foo.Bar;
|
||||
////var f2: /*type2*/Foo;
|
||||
/////*value2*/Foo.bind(this);
|
||||
////var f1: [|Foo|].Bar;
|
||||
////var f2: [|Foo|];
|
||||
////[|Foo|].bind(this);
|
||||
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.referencesCountIs(2);
|
||||
});
|
||||
const [type1, namespace1, value1, namespace2, type2, value2] = test.ranges();
|
||||
verify.rangesReferenceEachOther([type1, type2]);
|
||||
verify.rangesReferenceEachOther([namespace1, namespace2]);
|
||||
verify.rangesReferenceEachOther([value1, value2]);
|
||||
|
||||
@@ -6,16 +6,9 @@
|
||||
////
|
||||
////function ATest() { }
|
||||
////
|
||||
////import /*definition*/alias = ATest;
|
||||
////import [|alias|] = ATest; // definition
|
||||
////
|
||||
////var a: /*namespace*/alias.Bar;
|
||||
/////*value*/alias.call(this);
|
||||
////var a: [|alias|].Bar; // namespace
|
||||
////[|alias|].call(this); // value
|
||||
|
||||
goTo.marker("definition");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("namespace");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("value");
|
||||
verify.referencesCountIs(3);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -2,38 +2,24 @@
|
||||
|
||||
// class and uninstanciated module
|
||||
|
||||
////class testClass {
|
||||
////class [|testClass|] {
|
||||
//// static staticMethod() { }
|
||||
//// method() { }
|
||||
////}
|
||||
////
|
||||
////module testClass {
|
||||
////module [|testClass|] {
|
||||
//// export interface Bar {
|
||||
////
|
||||
//// }
|
||||
////}
|
||||
////
|
||||
////var c1: /*class1*/testClass;
|
||||
////var c2: /*module*/testClass.Bar;
|
||||
/////*class2*/testClass.staticMethod();
|
||||
/////*class3*/testClass.prototype.method();
|
||||
/////*class4*/testClass.bind(this);
|
||||
////new /*class5*/testClass();
|
||||
////var c1: [|testClass|];
|
||||
////var c2: [|testClass|].Bar;
|
||||
////[|testClass|].staticMethod();
|
||||
////[|testClass|].prototype.method();
|
||||
////[|testClass|].bind(this);
|
||||
////new [|testClass|]();
|
||||
|
||||
goTo.marker("module");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("class1");
|
||||
verify.referencesCountIs(6);
|
||||
|
||||
goTo.marker("class2");
|
||||
verify.referencesCountIs(6);
|
||||
|
||||
goTo.marker("class3");
|
||||
verify.referencesCountIs(6);
|
||||
|
||||
goTo.marker("class4");
|
||||
verify.referencesCountIs(6);
|
||||
|
||||
goTo.marker("class5");
|
||||
verify.referencesCountIs(6);
|
||||
const [class0, module0, class1, module1, class2, class3, class4, class5] = test.ranges();
|
||||
verify.rangesReferenceEachOther([module0, module1]);
|
||||
verify.rangesReferenceEachOther([class0, class1, class2, class3, class4, class5]);
|
||||
|
||||
@@ -2,28 +2,24 @@
|
||||
|
||||
// class and instanciated module
|
||||
|
||||
////class testClass {
|
||||
////class [|testClass|] {
|
||||
//// static staticMethod() { }
|
||||
//// method() { }
|
||||
////}
|
||||
////
|
||||
////module testClass {
|
||||
////module [|testClass|] {
|
||||
//// export interface Bar {
|
||||
////
|
||||
//// }
|
||||
//// export var s = 0;
|
||||
////}
|
||||
////
|
||||
////var c1: /*1*/testClass;
|
||||
////var c2: /*2*/testClass.Bar;
|
||||
/////*3*/testClass.staticMethod();
|
||||
/////*4*/testClass.prototype.method();
|
||||
/////*5*/testClass.bind(this);
|
||||
/////*6*/testClass.s;
|
||||
////new /*7*/testClass();
|
||||
////var c1: [|testClass|];
|
||||
////var c2: [|testClass|].Bar;
|
||||
////[|testClass|].staticMethod();
|
||||
////[|testClass|].prototype.method();
|
||||
////[|testClass|].bind(this);
|
||||
////[|testClass|].s;
|
||||
////new [|testClass|]();
|
||||
|
||||
// Instanciated Module and class intersect in the value space, so we consider them all one group
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.referencesCountIs(9);
|
||||
});
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////interface Foo { }
|
||||
////module Foo { export interface Bar { } }
|
||||
////function Foo() { }
|
||||
////interface [|Foo|] { }
|
||||
////module [|Foo|] { export interface Bar { } }
|
||||
////function [|Foo|]() { }
|
||||
////
|
||||
////export = /*1*/Foo;
|
||||
////export = [|Foo|];
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(4);
|
||||
const [r0, r1, r2, r3] = test.ranges();
|
||||
verify.referencesOf(r3, [r0, r1, r2, r3]);
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////interface Foo { }
|
||||
////module Foo {
|
||||
////module [|Foo|] {
|
||||
//// export interface Bar { }
|
||||
//// export module Bar { export interface Baz { } }
|
||||
//// export function Bar() { }
|
||||
////}
|
||||
////
|
||||
////// module
|
||||
////import a1 = /*1*/Foo;
|
||||
////import a1 = [|Foo|];
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(2);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
////interface Foo { }
|
||||
////module Foo {
|
||||
//// export interface Bar { }
|
||||
//// export module Bar { export interface Baz { } }
|
||||
//// export function Bar() { }
|
||||
//// export interface [|Bar|] { }
|
||||
//// export module [|Bar|] { export interface Baz { } }
|
||||
//// export function [|Bar|]() { }
|
||||
////}
|
||||
////
|
||||
////// module, value and type
|
||||
////import a2 = Foo./*1*/Bar;
|
||||
////import a2 = Foo.[|Bar|];
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(4);
|
||||
const [r0, r1, r2, r3] = test.ranges();
|
||||
verify.referencesOf(r3, [r0, r1, r2, r3]);
|
||||
|
||||
@@ -3,12 +3,11 @@
|
||||
////interface Foo { }
|
||||
////module Foo {
|
||||
//// export interface Bar { }
|
||||
//// export module Bar { export interface Baz { } }
|
||||
//// export module [|Bar|] { export interface Baz { } }
|
||||
//// export function Bar() { }
|
||||
////}
|
||||
////
|
||||
////// module
|
||||
////import a3 = Foo./*1*/Bar.Baz;
|
||||
////import a3 = Foo.[|Bar|].Baz;
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(2);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
////}
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(0);
|
||||
verify.referencesAre([]);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(0);
|
||||
verify.referencesAre([]);
|
||||
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(0);
|
||||
verify.referencesAre([]);
|
||||
|
||||
goTo.marker("4");
|
||||
verify.referencesCountIs(0);
|
||||
verify.referencesAre([]);
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////class Foo {
|
||||
//// public /*1*/12: any;
|
||||
//// public [|12|]: any;
|
||||
////}
|
||||
////
|
||||
////var x: Foo;
|
||||
////x[/*2*/12];
|
||||
////x = { "12": 0 };
|
||||
////x = { /*3*/12: 0 };
|
||||
////x[[|12|]];
|
||||
////x = { "[|12|]": 0 };
|
||||
////x = { [|12|]: 0 };
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.referencesCountIs(4);
|
||||
});
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -2,14 +2,10 @@
|
||||
|
||||
// References to an object literal property
|
||||
|
||||
////var x = { /*1*/add: 0, b: "string" };
|
||||
////x["add"];
|
||||
////x./*2*/add;
|
||||
////var x = { [|add|]: 0, b: "string" };
|
||||
////x["[|add|]"];
|
||||
////x.[|add|];
|
||||
////var y = x;
|
||||
////y.add;
|
||||
////y.[|add|];
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(4);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(4);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -3,82 +3,76 @@
|
||||
////module FindRef3 {
|
||||
//// module SimpleClassTest {
|
||||
//// export class Foo {
|
||||
//// public foo(): void {
|
||||
//// public [|foo|](): void {
|
||||
//// }
|
||||
//// }
|
||||
//// export class Bar extends Foo {
|
||||
//// public foo(): void {
|
||||
//// public [|foo|](): void {
|
||||
//// }
|
||||
//// }
|
||||
//// }
|
||||
////
|
||||
//// module SimpleInterfaceTest {
|
||||
//// export interface IFoo {
|
||||
//// foo(): void;
|
||||
//// [|ifoo|](): void;
|
||||
//// }
|
||||
//// export interface IBar extends IFoo {
|
||||
//// foo(): void;
|
||||
//// [|ifoo|](): void;
|
||||
//// }
|
||||
//// }
|
||||
////
|
||||
//// module SimpleClassInterfaceTest {
|
||||
//// export interface IFoo {
|
||||
//// foo(): void;
|
||||
//// [|icfoo|](): void;
|
||||
//// }
|
||||
//// export class Bar implements IFoo {
|
||||
//// public foo(): void {
|
||||
//// public [|icfoo|](): void {
|
||||
//// }
|
||||
//// }
|
||||
//// }
|
||||
////
|
||||
//// module Test {
|
||||
//// export interface IBase {
|
||||
//// field: string;
|
||||
//// method(): void;
|
||||
//// [|field|]: string;
|
||||
//// [|method|](): void;
|
||||
//// }
|
||||
////
|
||||
//// export interface IBlah extends IBase {
|
||||
//// field: string;
|
||||
//// [|field|]: string;
|
||||
//// }
|
||||
////
|
||||
//// export interface IBlah2 extends IBlah {
|
||||
//// field: string;
|
||||
//// [|field|]: string;
|
||||
//// }
|
||||
////
|
||||
//// export interface IDerived extends IBlah2 {
|
||||
//// method(): void;
|
||||
//// [|method|](): void;
|
||||
//// }
|
||||
////
|
||||
//// export class Bar implements IDerived {
|
||||
//// public field: string;
|
||||
//// public method(): void { }
|
||||
//// public [|field|]: string;
|
||||
//// public [|method|](): void { }
|
||||
//// }
|
||||
////
|
||||
//// export class BarBlah extends Bar {
|
||||
//// public field: string;
|
||||
//// public [|field|]: string;
|
||||
//// }
|
||||
//// }
|
||||
////
|
||||
//// function test() {
|
||||
//// var x = new SimpleClassTest.Bar();
|
||||
//// x.fo/*1*/o();
|
||||
//// x.[|foo|]();
|
||||
////
|
||||
//// var y: SimpleInterfaceTest.IBar = null;
|
||||
//// y.fo/*2*/o();
|
||||
//// y.[|ifoo|]();
|
||||
////
|
||||
//// var w: SimpleClassInterfaceTest.Bar = null;
|
||||
//// w.[|icfoo|]();
|
||||
////
|
||||
//// var z = new Test.BarBlah();
|
||||
//// z.fi/*3*/eld = "";
|
||||
//// z.[|field|] = "";
|
||||
//// z.[|method|]();
|
||||
//// }
|
||||
////}
|
||||
|
||||
// References to a field declared in a base class.
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
// References to a field declared in a base interface.
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
// References to a field declared in a chain of base class and interfaces.
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(6);
|
||||
verify.rangesWithSameTextReferenceEachOther();
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////interface IFoo<T> {
|
||||
//// /*1*/doSomething(v: T): T;
|
||||
//// [|doSomething|](v: T): T;
|
||||
////}
|
||||
////
|
||||
////var x: IFoo<string>;
|
||||
////x.doSomething("ss");
|
||||
////x.[|doSomething|]("ss");
|
||||
////
|
||||
////var y: IFoo<number>;
|
||||
////y.doSomething(12);
|
||||
////y.[|doSomething|](12);
|
||||
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(3);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -6,35 +6,28 @@
|
||||
////var n = 43;
|
||||
////
|
||||
////class foo {
|
||||
//// static n = '';
|
||||
//// static [|n|] = '';
|
||||
////
|
||||
//// public bar() {
|
||||
//// foo./*1*/n = "'";
|
||||
//// if(foo.n) {
|
||||
//// var x = foo.n;
|
||||
//// foo.[|n|] = "'";
|
||||
//// if(foo.[|n|]) {
|
||||
//// var x = foo.[|n|];
|
||||
//// }
|
||||
//// }
|
||||
////}
|
||||
////
|
||||
////class foo2 {
|
||||
//// private x = foo./*2*/n;
|
||||
//// private x = foo.[|n|];
|
||||
//// constructor() {
|
||||
//// foo./*3*/n = x;
|
||||
//// foo.[|n|] = x;
|
||||
//// }
|
||||
////
|
||||
//// function b(n) {
|
||||
//// n = foo.n;
|
||||
//// n = foo.[|n|];
|
||||
//// }
|
||||
////}
|
||||
|
||||
// @Filename: referencesOnStatic_2.ts
|
||||
////var q = foo.n;
|
||||
////var q = foo.[|n|];
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(8);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(8);
|
||||
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(8);
|
||||
verify.rangesReferenceEachOther();
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
////var bar = 0;
|
||||
|
||||
for (const marker of test.markers()) {
|
||||
verify.referencesCountIs(0);
|
||||
verify.referencesAre([]);
|
||||
}
|
||||
|
||||
@@ -86,19 +86,19 @@
|
||||
////
|
||||
//////Remotes
|
||||
//////Type test
|
||||
////var remoteclsTest: rem/*2*/otefooCls;
|
||||
////var remoteclsTest: [|remotefooCls|];
|
||||
////
|
||||
//////Arguments
|
||||
////remoteclsTest = new remotefooCls(remoteglo/*4*/balVar);
|
||||
////remotefoo(remotegl/*3*/obalVar);
|
||||
////remoteclsTest = new [|remotefooCls|]([|remoteglobalVar|]);
|
||||
////remotefoo([|remoteglobalVar|]);
|
||||
////
|
||||
//////Increments
|
||||
////remotefooCls.remoteclsSVar++;
|
||||
////[|remotefooCls|].[|remoteclsSVar|]++;
|
||||
////remotemodTest.remotemodVar++;
|
||||
/////*1*/remoteglobalVar = remoteglobalVar + remoteglobalVar;
|
||||
////[|remoteglobalVar|] = [|remoteglobalVar|] + [|remoteglobalVar|];
|
||||
////
|
||||
//////ETC - Other cases
|
||||
////remoteglobalVar = 3;
|
||||
////[|remoteglobalVar|] = 3;
|
||||
////
|
||||
//////Find References misses method param
|
||||
////var
|
||||
@@ -119,18 +119,18 @@
|
||||
////});
|
||||
|
||||
// @Filename: remoteGetReferences_2.ts
|
||||
////var remoteglobalVar: number = 2;
|
||||
////var [|remoteglobalVar|]: number = 2;
|
||||
////
|
||||
////class remotefooCls {
|
||||
////class [|remotefooCls|] {
|
||||
//// //Declare
|
||||
//// rem/*5*/oteclsVar = 1;
|
||||
//// static r/*6*/emoteclsSVar = 1;
|
||||
//// [|remoteclsVar|] = 1;
|
||||
//// static [|remoteclsSVar|] = 1;
|
||||
////
|
||||
//// constructor(public remoteclsParam: number) {
|
||||
//// //Increments
|
||||
//// remoteglobalVar++;
|
||||
//// this.remoteclsVar++;
|
||||
//// remotefooCls.remoteclsSVar++;
|
||||
//// [|remoteglobalVar|]++;
|
||||
//// this.[|remoteclsVar|]++;
|
||||
//// [|remotefooCls|].[|remoteclsSVar|]++;
|
||||
//// this.remoteclsParam++;
|
||||
//// remotemodTest.remotemodVar++;
|
||||
//// }
|
||||
@@ -141,8 +141,8 @@
|
||||
//// var remotefnVar = 1;
|
||||
////
|
||||
//// //Increments
|
||||
//// remotefooCls.remoteclsSVar++;
|
||||
//// remoteglobalVar++;
|
||||
//// [|remotefooCls|].[|remoteclsSVar|]++;
|
||||
//// [|remoteglobalVar|]++;
|
||||
//// remotemodTest.remotemodVar++;
|
||||
//// remotefnVar++;
|
||||
////
|
||||
@@ -155,8 +155,8 @@
|
||||
//// export var remotemodVar: number;
|
||||
////
|
||||
//// //Increments
|
||||
//// remoteglobalVar++;
|
||||
//// remotefooCls.remoteclsSVar++;
|
||||
//// [|remoteglobalVar|]++;
|
||||
//// [|remotefooCls|].[|remoteclsSVar|]++;
|
||||
//// remotemodVar++;
|
||||
////
|
||||
//// class remotetestCls {
|
||||
@@ -167,8 +167,8 @@
|
||||
//// static remoteboo = remotefoo;
|
||||
////
|
||||
//// //Increments
|
||||
//// remoteglobalVar++;
|
||||
//// remotefooCls.remoteclsSVar++;
|
||||
//// [|remoteglobalVar|]++;
|
||||
//// [|remotefooCls|].[|remoteclsSVar|]++;
|
||||
//// remotemodVar++;
|
||||
//// }
|
||||
////
|
||||
@@ -177,26 +177,4 @@
|
||||
//// }
|
||||
////}
|
||||
|
||||
// References to a variable declared in global.
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(11);
|
||||
|
||||
// References to a type.
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(8);
|
||||
|
||||
// References to a function argument.
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(11);
|
||||
|
||||
// References to a class argument.
|
||||
goTo.marker("4");
|
||||
verify.referencesCountIs(11);
|
||||
|
||||
// References to a variable declared in a class.
|
||||
goTo.marker("5");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
// References to static variable declared in a class.
|
||||
goTo.marker("6");
|
||||
verify.referencesCountIs(6);
|
||||
verify.rangesWithSameTextReferenceEachOther();
|
||||
|
||||
Reference in New Issue
Block a user